Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CustomizeRequestOption func signature #39

Open
wormi4ok opened this issue May 20, 2024 · 2 comments
Open

Update CustomizeRequestOption func signature #39

wormi4ok opened this issue May 20, 2024 · 2 comments
Labels
chore Maintenance

Comments

@wormi4ok
Copy link

Summary

There is a breaking change in the testcontainers-go dependency, that requires CustomizeRequestOption functions to return an error now. There are multiple places where this func signature is used. To stay up to date with the testcontainers project, the functions need to be updated.

As far as I understood, updating the dependency will also bump the minimal go version for wiremock-testcontainers-go to go 1.21

References

testcontainers/testcontainers-go#2267

@wormi4ok wormi4ok added the chore Maintenance label May 20, 2024
@ninadingole
Copy link

PR #40 is already merged for this and we could close this issue now

@connorsadler
Copy link

I believe I've run into an issue related to this tweak

I've been trying to use the examples/quickstart/quickstart_test.go
and found that there is an 'replace' (override) in examples/quickstart/go.mod
like this:

replace github.com/wiremock/wiremock-testcontainers-go => ../../../wiremock-testcontainers-go // needed to use new method written localy in the quickstart_test.go

AFAIK I need to remove that in order to use wiremock-testcontainers-go in my own project
So I removed the line above
Then when I run quickstart_test.go I see errors:

/Users/connor/go/pkg/mod/github.com/wiremock/[email protected]/tc-wiremock.go:94:9: cannot use func(req *testcontainers.GenericContainerRequest) {…} (value of type func(req *testcontainers.GenericContainerRequest)) as testcontainers.CustomizeRequestOption value in return statement
/Users/connor/go/pkg/mod/github.com/wiremock/[email protected]/tc-wiremock.go:107:9: cannot use func(req *testcontainers.GenericContainerRequest) {…} (value of type func(req *testcontainers.GenericContainerRequest)) as testcontainers.CustomizeRequestOption value in return statement
/Users/connor/go/pkg/mod/github.com/wiremock/[email protected]/tc-wiremock.go:119:9: cannot use func(req *testcontainers.GenericContainerRequest) {…} (value of type func(req *testcontainers.GenericContainerRequest)) as testcontainers.CustomizeRequestOption value in return statement

which led me to this thread/issue.

Fix
The fix I believe is to:

  • remove the 'replace' (override) in examples/quickstart/go.mod as above
  • also bump the version in that same file to:
require github.com/wiremock/wiremock-testcontainers-go v1.0.0-alpha-9

I can raise a PR for that if you like
This will then let someone copy the quickstart and use wiremock-testcontainers-go in their own project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance
Projects
None yet
Development

No branches or pull requests

3 participants