Skip to content

Commit

Permalink
ci: 支持 go1.22
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Feb 27, 2024
1 parent b644db7 commit 39c5ac7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
go: ['1.20.x', '1.17.x']
go: ['1.22.x', '1.17.x']

steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v3
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
id: go
Expand Down
5 changes: 2 additions & 3 deletions cmdopt.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type CmdOpt struct {
// FlagSet 可用于绑定各个命令行参数;
// 返回值 [DoFunc] 表示实际执行的函数;
//
// 一般与 DoFunc 组合使用:
// 一般与 [DoFunc] 组合使用:
//
// func(fs *flag.FlagSet) DoFunc {
// f1 := fs.Bool("f1", true, "usage")
Expand All @@ -41,8 +41,7 @@ type CmdOpt struct {
// }
// }
//
// 在 CommandFunc 中初始化 flag 参数,在 CommandFunc 的返回函数中作实际处理,
// 这样可以防止大量的全局变量的声明。
// 在 CommandFunc 中初始化 flag 参数,并在其返回函数中作实际处理,这样可以防止大量的全局变量的声明。
//
// 如非必要情况,CommandFunc 的 FlagSet 只用于绑定参数,不应该修改其相关配置。
type CommandFunc = func(*flag.FlagSet) DoFunc
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/issue9/cmdopt

require github.com/issue9/assert/v3 v3.0.5
require github.com/issue9/assert/v3 v3.1.0

go 1.17
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/issue9/assert/v3 v3.0.5 h1:Mlz/4v2Ph6ZDm3Fk3A1jhitH4M/2dkHeHNKe7tTZdH8=
github.com/issue9/assert/v3 v3.0.5/go.mod h1:yft/uaskRpwQTyBT3n1zRl91SR1wNlO4fLZHzOa4bdM=
github.com/issue9/assert/v3 v3.1.0 h1:oxLFXS7QnBKI4lB31pRoYO96yErkWAJtR7iv+LNjAPg=
github.com/issue9/assert/v3 v3.1.0/go.mod h1:yft/uaskRpwQTyBT3n1zRl91SR1wNlO4fLZHzOa4bdM=

0 comments on commit 39c5ac7

Please sign in to comment.