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

Bump CI to use supported go version, fix a single Go 1.20 issue in mount pkg; rm uneeded errorlint annotations #129

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Expand Up @@ -4,12 +4,12 @@ jobs:
test:
strategy:
matrix:
go-version: [1.17.x, 1.18.x]
go-version: [1.17.x, 1.20.x, 1.21.x]
platform: [ubuntu-20.04, ubuntu-22.04, windows-latest, macos-11]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -48,7 +48,7 @@ lint: $(BINDIR)/golangci-lint
done

$(BINDIR)/golangci-lint: $(BINDIR)
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(BINDIR) v1.45.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(BINDIR) v1.55.1

$(BINDIR):
mkdir -p $(BINDIR)
Expand Down
4 changes: 2 additions & 2 deletions mount/go.mod
@@ -1,8 +1,8 @@
module github.com/moby/sys/mount

go 1.16
go 1.17

require (
github.com/moby/sys/mountinfo v0.6.2
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
golang.org/x/sys v0.1.0
)
3 changes: 2 additions & 1 deletion mount/go.sum
@@ -1,4 +1,5 @@
github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vygl78=
github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
5 changes: 3 additions & 2 deletions mount/mount_unix.go
Expand Up @@ -23,7 +23,7 @@ func Mount(device, target, mType, options string) error {
// a normal unmount. If target is not a mount point, no error is returned.
func Unmount(target string) error {
err := unix.Unmount(target, mntDetach)
if err == nil || err == unix.EINVAL { //nolint:errorlint // unix errors are bare
if err == nil || err == unix.EINVAL {
// Ignore "not mounted" error here. Note the same error
// can be returned if flags are invalid, so this code
// assumes that the flags value is always correct.
Expand Down Expand Up @@ -71,7 +71,8 @@ func RecursiveUnmount(target string) error {
if err != nil {
if i == lastMount {
if suberr != nil {
return fmt.Errorf("%w (possible cause: %s)", err, suberr)
// TODO: switch to %w for suberr once we stop supporting go < 1.20.
return fmt.Errorf("%w (possible cause: %s)", err, suberr.Error())
}
return err
}
Expand Down
4 changes: 2 additions & 2 deletions mountinfo/go.mod
@@ -1,5 +1,5 @@
module github.com/moby/sys/mountinfo

go 1.16
go 1.17

require golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
require golang.org/x/sys v0.1.0
4 changes: 2 additions & 2 deletions mountinfo/go.sum
@@ -1,2 +1,2 @@
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
2 changes: 1 addition & 1 deletion sequential/go.mod
Expand Up @@ -2,4 +2,4 @@ module github.com/moby/sys/sequential

go 1.17

require golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
require golang.org/x/sys v0.1.0
4 changes: 2 additions & 2 deletions sequential/go.sum
@@ -1,2 +1,2 @@
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
6 changes: 4 additions & 2 deletions sequential/sequential_windows.go
Expand Up @@ -111,8 +111,10 @@ func openSequential(path string, mode int) (fd windows.Handle, err error) {
}

// Helpers for CreateTemp
var rand uint32
var randmu sync.Mutex
var (
rand uint32
randmu sync.Mutex
)

func reseed() uint32 {
return uint32(time.Now().UnixNano() + int64(os.Getpid()))
Expand Down
4 changes: 2 additions & 2 deletions signal/go.mod
@@ -1,5 +1,5 @@
module github.com/moby/sys/signal

go 1.16
go 1.17

require golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
require golang.org/x/sys v0.1.0
4 changes: 2 additions & 2 deletions signal/go.sum
@@ -1,2 +1,2 @@
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
4 changes: 2 additions & 2 deletions symlink/go.mod
@@ -1,5 +1,5 @@
module github.com/moby/sys/symlink

go 1.16
go 1.17

require golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
require golang.org/x/sys v0.1.0
4 changes: 2 additions & 2 deletions symlink/go.sum
@@ -1,2 +1,2 @@
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a h1:dGzPydgVsqGcTRVwiLJ1jVbufYwmzD3LfVPLKsKg+0k=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=