Hey all! I’m looking through the examples in pact-...
# pact-go
w
Hey all! I’m looking through the examples in pact-go, and in some of the tests where you’re specifying things like headers, some the values that are strings look like
S("string")
and I have absolutely no idea what the
S
relates to. GoLand obvs complains about it as well, but I’ve noticed if you add the flag to ignore the file by the build tool, it stops complaining. Anyone have any ideas what it’s for or what it does? I’m guessing it’s meant to represent a string value to Pact, but then not sure why GoLand doesn’t like it
m
In some examples
S
is aliased to a function, because the type it accepts is a matcher
I'm guessing goland doesn't like type aliases?
w
Hmmm so looking in https://github.com/pact-foundation/pact-go/blob/2.x.x/examples/consumer_v3_test.go, I’m not sure what S is meant to alias too 🤔
Oh I’ve found it
It’s in the basic_test.go file
All fixed Matt, thanks for the quick response 😄
Also Matt, one other question whilst you’re here. How come all the pact libraries continue to support multiple versions of the Pact spec? It feels like it would be more straightforward to just deprecate the prior version of the spec when the new one is released, or at least, it’s felt kinda confusing coming into Pact with fresh eyes and not really understanding why there are multiple examples with diff versions of Pact and it not being super obvious what should or shouldn’t be used 😄