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

v2 and go modules #232

Closed
cludden opened this issue Jul 11, 2019 · 3 comments
Closed

v2 and go modules #232

cludden opened this issue Jul 11, 2019 · 3 comments

Comments

@cludden
Copy link
Contributor

cludden commented Jul 11, 2019

Hey @Jeffail, I'm looking to embed benthos in another application, and running into issues with go modules. Out of curiosity, does the go.mod module directive need to be updated to include /v2 in accordance with https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher?

@Jeffail
Copy link
Collaborator

Jeffail commented Jul 11, 2019

Hey @cludden,

Unfortunately with the V2 release I got stuck in an awkward position. I was already using modules to manage Benthos' own dependencies but when it came to the V2 release I was going to have to break compatibility with dep if I updated all the local import paths to be module compliant.

What I did instead was bump the major version but leave the go.mod unchanged, this is breaking the rules of Go modules, but in practice it actually works just fine with both dep and modules. With dep everything is the same, with modules you need to target the version tag as if Benthos didn't support modules at all.

To get the latest version of Benthos as a dependency (currently v2.8.6) you can run:

go get github.com/Jeffail/benthos@v2.8.6

That'll give you an ugly entry in your own go.mod as it judges Benthos as non-compliant, therefore using a pseudo version in the listing. Practically, however, it's all the same. Your import paths should still point to github.com/Jeffail/benthos.

My plan is that when modules are the Go tool default I'll do a major version bump that jumps straight into full modules compliance. At that point you'll be forced to use modules and use the github.com/Jeffail/benthos/v3.

@Jeffail
Copy link
Collaborator

Jeffail commented Jul 11, 2019

The plugin example repo https://github.com/benthosdev/benthos-plugin-example shows you what that looks like.

@cludden
Copy link
Contributor Author

cludden commented Jul 12, 2019

Thanks for the quick reply!

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

No branches or pull requests

2 participants