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

all: update supported go versions to 1.17 and 1.16 #3827

Merged
merged 6 commits into from
Aug 20, 2021
Merged

all: update supported go versions to 1.17 and 1.16 #3827

merged 6 commits into from
Aug 20, 2021

Conversation

leighmcculloch
Copy link
Member

What

Update supported Go versions to 1.17 and 1.16.

Why

Go 1.15 is no longer supported. Go 1.17 has been released.

Known limitations

N/A

@@ -30,7 +30,6 @@ require (
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jarcoal/httpmock v0.0.0-20161210151336-4442edb3db31
github.com/jmoiron/sqlx v1.2.0
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88 // indirect
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go 1.16 and 1.17 narrow the definition of what needs to be listed in the go.mod file. The Go 1.16 rules apply because we specify go 1.16 at the top of the file.

go list -deps -test -f '{{with .Module}}{{.Path}} {{.Version}}{{end}}' ./... | LC_ALL=C sort -u
go list -f '{{with .Module}}{{.Path}} {{.Version}}{{end}}' all | LC_ALL=C sort -u
Copy link
Member Author

@leighmcculloch leighmcculloch Aug 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go 1.17 narrows the definition of all so that it is equivalent and using all here is the recommended approach for getting this info now. Previously all would include all modules in the dependency graph and not only modules that get compiled in.

c := make(chan os.Signal)
c := make(chan os.Signal, 1)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is to fix a go vet error. It's unsafe to use an unbuffered channel with signal.Notify because the runtime does an unbuffered send to the channel, so if the interrupt happens to arrive between the setup and the consumption the signal can be lost. I don't think this has any critical impact because this appears to be in integration tests and we call <-c so soon after setting up the notify there's only a tiny window. Fixing none-the-less to make the go vet error go away.

More details are available at golang/go#45043.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ire-and-curses You already approved, but FYI ☝🏻 additional change required.

Comment on lines -32 to +34
P{Type: "foo"},
P{Type: "foo", Status: 500},
[]string{"foo"},
0,
500,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The actual response writer used by the stdlib http.Server has never supported zero status codes, however in Go 1.16 and earlier the httptest.ResponseRecorder did. In Go 1.17 the recorder was updated to also error, so that it has the same behavior as the real response writer. We use the recorder in some tests and some tests avoided setting the status code to a non-zero value. For Go 1.17 they need updating. More details at golang/go#45353.

@2opremio
Copy link
Contributor

@leighmcculloch I think we need to change the repo configuration so that it doesn't block on check_code_1_16 and test_code_1_15 ?

@leighmcculloch
Copy link
Member Author

@2opremio Yup I'm waiting on @ire-and-curses to merge that change now.

@leighmcculloch leighmcculloch merged commit 5485133 into stellar:master Aug 20, 2021
@leighmcculloch leighmcculloch deleted the go117 branch August 20, 2021 15:41
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

Successfully merging this pull request may close these issues.

None yet

3 participants