Skip to content

Commit

Permalink
chore: 最低依赖版本改为 go1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Mar 29, 2024
1 parent 2818ac7 commit aa7604c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ jobs:
test:
name: Test
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
go: ['1.18.x', '1.22.x']
go: ['1.21.x', '1.22.x']

steps:

- name: Check out code into the Go module directory
Expand All @@ -25,11 +25,12 @@ jobs:

- name: Vet
run: go vet -v ./...

- name: Test
run: go test -v -coverprofile='coverage.txt' -covermode=atomic ./...

- name: Upload Coverage report
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.txt
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
module github.com/issue9/source

go 1.18
go 1.21

require (
github.com/issue9/assert/v4 v4.1.1
github.com/issue9/errwrap v0.3.2
github.com/issue9/sliceutil v0.16.0
golang.org/x/mod v0.16.0
)
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ github.com/issue9/assert/v4 v4.1.1 h1:OhPE8SB8n/qZCNGLQa+6MQtr/B3oON0JAVj68k8jJl
github.com/issue9/assert/v4 v4.1.1/go.mod h1:v7qDRXi7AsaZZNh8eAK2rkLJg5/clztqQGA1DRv9Lv4=
github.com/issue9/errwrap v0.3.2 h1:7KEme9Pfe75M+sIMcPCn/DV90wjnOcRbO4DXVAHj3Fw=
github.com/issue9/errwrap v0.3.2/go.mod h1:KcCLuUGiffjooLCUjL89r1cyO8/HT/VRcQrneO53N3A=
github.com/issue9/sliceutil v0.16.0 h1:+gyumWF126mprQLiUi14s6SAeucMg1vuyPEh66VTtC8=
github.com/issue9/sliceutil v0.16.0/go.mod h1:ldun6sT4/bOJxuMtOXhtc6P7GCwE7L+avV86HNks7qk=
golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic=
golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
4 changes: 2 additions & 2 deletions mod.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"os"
"path"
"path/filepath"
"slices"

"github.com/issue9/sliceutil"
"golang.org/x/mod/modfile"
)

Expand Down Expand Up @@ -118,7 +118,7 @@ LOOP:
}

pkgNames = append(pkgNames, mod.Module.Mod.Path)
sliceutil.Reverse(pkgNames)
slices.Reverse(pkgNames)
return path.Join(pkgNames...), nil
case errors.Is(err, os.ErrNotExist):
// 这两行不能用 filepath.Split 代替,split 会为 abs1 留下最后的分隔符,
Expand Down

0 comments on commit aa7604c

Please sign in to comment.