trying to follow the v4 example consumer for 2.x.x...
# pact-go
j
trying to follow the v4 example consumer for 2.x.x but can’t seem to get the matcher to work. it seems to want to do an exact match on the request no matter which matcher I select. this is in my WithRequest block:
Copy code
Header("Authorization", matchers.Like("Bearer 111.222.333")).
and get this error running the consumer test:
Copy code
2022/11/01 22:28:59 [INFO] pact validation failed, errors: 
                        Mismatch with header 'Authorization': Expected 'Bearer 111.222.333' to be equal to 'Bearer aaa.bbb.ccc'
:                       expected:        Bearer 111.222.333
                        actual:          Bearer aaa.bbb.ccc
here is the CLI:
Copy code
~/go/bin/pact-go version
Pact Go CLI v2.0.0-beta.14
seeing same thing when using V3. for v3 matchers and injection from provider state callbacks should I be instead using the pact-go 1.7.0 version?
@Matt (pactflow.io / pact-js / pact-go) for 1.7, i see some code in message.go with provider state params, but not seeing references anywhere else. am i missing something?
ah - looks like the callbacks are tied to v3 generators? so would need to stick with 2.x.x. so just need to sort out how to get the matcher to work
after reinstalling things looks like v3 matchers are working as expected with 2.x.x
👍 1
m
sorry, was late to this party, but looks like you’ve sorted it. You’re right though,only 2.x.x supports the callbacks