-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[release/2.8] bump up golang version #3812
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,9 +114,7 @@ func (r *registry) Repositories(ctx context.Context, entries []string, last stri | |
return 0, err | ||
} | ||
|
||
for cnt := range ctlg.Repositories { | ||
entries[cnt] = ctlg.Repositories[cnt] | ||
} | ||
copy(entries, ctlg.Repositories) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks unrelated as well; looks like it was part of fbdfd1a; which is Not sure if we want to backport that as a whole (it seems rather large), but if we want, should be separate. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My approach for these is usually to update golangci-lint first, and any changes related to updated linters together with that update (same PR, depending on the number of fixes needed, same commit). This makes it transparent that updates were needed due to stricter linters. Golang updates (besides the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So, in general, you would want us to fix all the prerequisites for the go upgrade, and then have this pr focus only on the go version upgrade. i understand, but, it's not easy to decouple the fix for golangci-lint from the version upgrade of go, because there is some correlation between the versions of go and golangci-lint. Put all these changes together because they are what is needed for the upgraded version from the point of view of code changes. |
||
numFilled = len(ctlg.Repositories) | ||
|
||
link := resp.Header.Get("Link") | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//go:build go1.4 | ||
// +build go1.4 | ||
|
||
package handlers | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//go:build !noresumabledigest | ||
// +build !noresumabledigest | ||
|
||
package storage | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -279,6 +279,9 @@ func (f *file) sectionReader(offset int64) io.Reader { | |
} | ||
|
||
func (f *file) ReadAt(p []byte, offset int64) (n int, err error) { | ||
if offset >= int64(len(f.data)) { | ||
return 0, io.EOF | ||
} | ||
Comment on lines
+282
to
+284
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like it's not directly related to the Go update, or if it's needed, should be in it's own commit (cherry-pick); coming from Backporting that fix is good, but should not be stuffed in together with a go update (if it's a separate PR, we can also point to it in the release notes) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this must be in, otherwise one UT will panic as mentioned in #3614 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For sure, the fix is good, but it's not directly related to go1.18? My issue is mainly that stuffing bug fixes into a commit that only mentions "update go version" hides them. This makes it hard to find back fixes;
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not directly related to Go 1.18, but without this change, UT would have failed. If I first try to pick a fix, like #3815, there are some faults on Go 1.16 that I don't think are worth investigating. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @wy65701436 do you want to rebase now that we've merged #3815 |
||
return copy(p, f.data[offset:]), nil | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
GOLANGCI_LINT_VERSION="v1.27.0" | ||
GOLANGCI_LINT_VERSION="v1.50.1" | ||
|
||
# | ||
# Install developer tools to $GOBIN (or $GOPATH/bin if unset) | ||
# | ||
set -eu -o pipefail | ||
|
||
cd /tmp | ||
go get -u github.com/LK4D4/vndr | ||
go get "github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}" | ||
go install github.com/LK4D4/vndr@latest | ||
go install "github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ var Package = "$(go list)" | |
// Version indicates which version of the binary is running. This is set to | ||
// the latest release tag by hand, always suffixed by "+unknown". During | ||
// build, it will be replaced by the actual version. The value here will be | ||
// used if the registry is run after a go get based install. | ||
// used if the registry is run after a go install based install. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like we didn't update this in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will raise pr on main later. |
||
var Version = "$(git describe --match 'v[0-9]*' --dirty='.m' --always)+unknown" | ||
|
||
// Revision is filled with the VCS (e.g. git) revision being used to build | ||
|
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 change is unrelated, and looks to be part of 3b391d3;
I suggest reverting this; if we want the other changes, we should backport it as a whole and having this partial change will complicate that (result in merge conflicts)
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.
again, it's to fix a goci-lint failure.