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
multi: Use go 1.16 features. #2722
Conversation
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 a bit torn on parts of this to be honest. We officially require newer versions of Go, but typically I prefer the code to unofficially work with older versions until there is some feature that is specifically required which means we really do need a newer version.
That said, I did notice it is changing the code without update the various go.mod
files to require the new minimum version those changes introduce. Updating a go.mod
to require a higher minimum version is, to me anyway, a red flag that should be carefully considered because it hoists all dependents into using a new Go version too.
EDIT: To be clear, the only commit I have any issue with is multi: Don't use deprecated ioutil package.
The rest of them look fine (minus the ordering issue I called out elsewhere).
30d62ce
to
b30c805
Compare
Reordered commits. Updated Ready for another look. |
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 looks good code wise now. The commit messages need to be updated to follow the model git commit messages format in the code contribution guidelines though. Specifically, it looks like they aren't wrapped.
Update Dockerfiles to use golang:1.17 as their base/build image, rather then golang:1.15.
As of go 1.16, the GO111MODULE environment variable defaults to "on", so it doesn't need to be set explicitly when building or testing.
As of go 1.16, the "io/ioutil" package is deprecated. All functionality from "io/ioutil" has been moved to either the "io" or "os" packages.
As of go 1.16, "go build" and "go test" now exit with an error rather than silently modifying go.mod or go.sum files. As a result, we don't need to manually check for altered mod/sum files in the test script.
Since the release of go 1.17, the supported versions listed in the README should be 1.16 and 1.17.
Now that Go 1.16 is the minimum supported version, we can take advantage of new features introduced in 1.16.
Also updating README and some Dockerfiles which were still referencing older versions of Go.