-
Notifications
You must be signed in to change notification settings - Fork 618
Go Modules #394
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
Go Modules #394
Conversation
go.mod
Outdated
@@ -0,0 +1,3 @@ | |||
module github.com/streadway/amqp | |||
|
|||
go 1.12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why we need this line while we still support go 1.10?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is new in Go 1.12: https://golang.org/doc/go1.12#modules
The go directive in a go.mod file now indicates the version of the language used by the files within that module. It will be set to the current release (go 1.12) if no existing version is present. If the go directive for a module specifies a version newer than the toolchain in use, the go command will attempt to build the packages regardless, and will note the mismatch only if that build fails.
It could probably be removed, It was automatically added during the go mod init
I ran.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m pretty sure this library uses version 1.9 (maybe a few features of 1.10) of the language. Does it make sense to change to something lower than 1.12?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly, it's a bit unclear to me if this should be an indicator of the current or minimal Go version the module supports.
I think it's probably safe to just remove it for now until it becomes clearer what the point of it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interestingly enough it seems we'll need to keep this value as go mod tidy
on Go 1.12+ re-adds it as go 1.12
each time.
I've asked on r/golang what the purpose of this value is and what it should be set too. We'll see what people have to say there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://go-review.googlesource.com/c/go/+/164318/ does seem to indicate this is a minimum Go version supported.
From: golang/go#30446 (comment)
What people say above is correct: when creating a module with Go 1.12, and thereby getting a go 1.12 in your go.mod file, you need to use at least Go 1.11.4 to build the module going forward. Closing because this is working as expected. I agree that this is imperfect but the only other option I see would be to delay all language changes for another six months, which seems severe.
I've swapped the value to be go 1.10
since this is the minimal version being tested in TravisCI. It's still pretty unclear to me what the impact of having a pre go 1.11 version is.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.11
is over 6 months old. I'd say it's a pretty safe bet.
Just to follow up post-merge I'm still not confident Lots of conversation still happening here: https://www.reddit.com/r/golang/comments/b0b8k3/what_version_should_the_gomod_go_directive_be_set/ |
@kpurdon thank you for sticking with it 👍 |
This serves as the most basic support of Go modules possible. Fixes #388.