Hi all, I use Pact-go <v2.XXX>. And I try to descr...
# pact-go
g
Hi all, I use Pact-go v2.XXX. And I try to describe a float number with a matcher like this:
Copy code
WithJSONBody(Map{
				"id":             Integer(21),
				"name":           S("foo 2"),
				"brand":          S("bar 2"),
				"price_incl_vat": Regex("23.125", "[0-9]+\\.[0-9]+"),
				"price_excl_tax": Regex("18.185", "[0-9]+\\.[0-9]+"),
			}).
but that generates a string and not a float, so when I unmarshal the response I have errors. How I can generate a float ?
1
Oh sorry, I found the right matcher, for that.
Decimal
m
Yep - you can’t regex a number 😉