Skip to content

Commit

Permalink
Merge pull request #129 from kolyshkin/bump-ci
Browse files Browse the repository at this point in the history
Bump CI to use supported go version, fix a single Go 1.20 issue in mount pkg; rm uneeded errorlint annotations
  • Loading branch information
thaJeztah authored Jul 3, 2024
2 parents 4950d76 + 4700bc3 commit 954b593
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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=

0 comments on commit 954b593

Please sign in to comment.