Skip to content

Commit 69dd493

Browse files
authored
Merge pull request #60 from thaJeztah/bump_go_versions
update to go1.23, update golangci-lint to v1.62, fix linting issues
2 parents 5a092d2 + 25dc041 commit 69dd493

File tree

8 files changed

+23
-26
lines changed

8 files changed

+23
-26
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
name: Set up Go
6666
uses: actions/setup-go@v5
6767
with:
68-
go-version: "1.20"
68+
go-version: "1.23"
6969
-
7070
name: Download modules
7171
run: |

.golangci.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ run:
33

44
linters:
55
enable:
6-
- deadcode
76
- depguard
87
- gofmt
98
- goimports
@@ -13,20 +12,18 @@ linters:
1312
- ineffassign
1413
- misspell
1514
- typecheck
16-
- varcheck
1715
- errname
1816
- makezero
1917
- whitespace
2018
disable-all: true
2119

2220
linters-settings:
2321
depguard:
24-
list-type: blacklist
25-
include-go-root: true
26-
packages:
27-
# The io/ioutil package has been deprecated.
28-
# https://go.dev/doc/go1.16#ioutil
29-
- io/ioutil
22+
rules:
23+
main:
24+
deny:
25+
- pkg: io/ioutil
26+
desc: The io/ioutil package has been deprecated, see https://go.dev/doc/go1.16#ioutil
3027
importas:
3128
no-unaliased: true
3229

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
ARG GO_VERSION="1.18"
18-
ARG GOLANGCI_LINT_VERSION="v1.45"
17+
ARG GO_VERSION="1.23"
18+
ARG GOLANGCI_LINT_VERSION="v1.62"
1919
ARG ADDLICENSE_VERSION="v1.0.0"
2020

2121
ARG LICENSE_ARGS="-c cli-docs-tool -l apache"

clidocstool_man_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestGenManTree(t *testing.T) {
5757
seen := make(map[string]struct{})
5858
remanpage := regexp.MustCompile(`\.\d+$`)
5959

60-
filepath.Walk("fixtures", func(path string, info fs.FileInfo, err error) error {
60+
_ = filepath.Walk("fixtures", func(path string, info fs.FileInfo, _ error) error {
6161
fname := filepath.Base(path)
6262
// ignore dirs and any file that is not a manpage
6363
if info.IsDir() || !remanpage.MatchString(fname) {
@@ -77,7 +77,7 @@ func TestGenManTree(t *testing.T) {
7777
return nil
7878
})
7979

80-
filepath.Walk(tmpdir, func(path string, info fs.FileInfo, err error) error {
80+
_ = filepath.Walk(tmpdir, func(path string, info fs.FileInfo, _ error) error {
8181
fname := filepath.Base(path)
8282
// ignore dirs and any file that is not a manpage
8383
if info.IsDir() || !remanpage.MatchString(fname) {

clidocstool_md_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func TestGenMarkdownTree(t *testing.T) {
4242

4343
seen := make(map[string]struct{})
4444

45-
filepath.Walk("fixtures", func(path string, info fs.FileInfo, err error) error {
45+
_ = filepath.Walk("fixtures", func(path string, info fs.FileInfo, _ error) error {
4646
fname := filepath.Base(path)
4747
// ignore dirs, .pre.md files and any file that is not a .md file
4848
if info.IsDir() || !strings.HasSuffix(fname, ".md") || strings.HasSuffix(fname, ".pre.md") {
@@ -62,7 +62,7 @@ func TestGenMarkdownTree(t *testing.T) {
6262
return nil
6363
})
6464

65-
filepath.Walk(tmpdir, func(path string, info fs.FileInfo, err error) error {
65+
_ = filepath.Walk(tmpdir, func(path string, info fs.FileInfo, _ error) error {
6666
fname := filepath.Base(path)
6767
// ignore dirs, .pre.md files and any file that is not a .md file
6868
if info.IsDir() || !strings.HasSuffix(fname, ".md") || strings.HasSuffix(fname, ".pre.md") {

clidocstool_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func setup() {
4949
SilenceUsage: true,
5050
SilenceErrors: true,
5151
TraverseChildren: true,
52-
Run: func(cmd *cobra.Command, args []string) {},
52+
Run: func(*cobra.Command, []string) {},
5353
Version: "20.10.8",
5454
DisableFlagsInUseLine: true,
5555
}
@@ -65,7 +65,7 @@ func setup() {
6565
Annotations: map[string]string{
6666
"aliases": "docker container attach, docker attach",
6767
},
68-
Run: func(cmd *cobra.Command, args []string) {},
68+
Run: func(*cobra.Command, []string) {},
6969
}
7070

7171
attachFlags := attachCmd.Flags()
@@ -86,7 +86,7 @@ func setup() {
8686
Use: "build [OPTIONS] PATH | URL | -",
8787
Aliases: []string{"b"},
8888
Short: "Start a build",
89-
Run: func(cmd *cobra.Command, args []string) {},
89+
Run: func(*cobra.Command, []string) {},
9090
Annotations: map[string]string{
9191
"aliases": "docker image build, docker buildx build, docker buildx b, docker build",
9292
},
@@ -95,19 +95,19 @@ func setup() {
9595
Use: "dial-stdio",
9696
Short: "Proxy current stdio streams to builder instance",
9797
Args: cobra.NoArgs,
98-
Run: func(cmd *cobra.Command, args []string) {},
98+
Run: func(*cobra.Command, []string) {},
9999
}
100100
buildxInstallCmd = &cobra.Command{
101101
Use: "install",
102102
Short: "Install buildx as a 'docker builder' alias",
103103
Args: cobra.ExactArgs(0),
104-
Run: func(cmd *cobra.Command, args []string) {},
104+
Run: func(*cobra.Command, []string) {},
105105
Hidden: true,
106106
}
107107
buildxStopCmd = &cobra.Command{
108108
Use: "stop [NAME]",
109109
Short: "Stop builder instance",
110-
Run: func(cmd *cobra.Command, args []string) {},
110+
Run: func(*cobra.Command, []string) {},
111111
}
112112

113113
buildxPFlags := buildxCmd.PersistentFlags()
@@ -255,7 +255,7 @@ func TestGenAllTree(t *testing.T) {
255255

256256
seen := make(map[string]struct{})
257257

258-
filepath.Walk("fixtures", func(path string, info fs.FileInfo, err error) error {
258+
_ = filepath.Walk("fixtures", func(path string, info fs.FileInfo, err error) error {
259259
fname := filepath.Base(path)
260260
// ignore dirs and .pre.md files
261261
if info.IsDir() || strings.HasSuffix(fname, ".pre.md") {
@@ -275,7 +275,7 @@ func TestGenAllTree(t *testing.T) {
275275
return nil
276276
})
277277

278-
filepath.Walk(tmpdir, func(path string, info fs.FileInfo, err error) error {
278+
_ = filepath.Walk(tmpdir, func(path string, info fs.FileInfo, _ error) error {
279279
fname := filepath.Base(path)
280280
// ignore dirs and .pre.md files
281281
if info.IsDir() || strings.HasSuffix(fname, ".pre.md") {

clidocstool_yaml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ type cmdDoc struct {
7777
// subcmds, `sub` and `sub-third`, and `sub` has a subcommand called `third`
7878
// it is undefined which help output will be in the file `cmd-sub-third.1`.
7979
func (c *Client) GenYamlTree(cmd *cobra.Command) error {
80-
emptyStr := func(s string) string { return "" }
80+
emptyStr := func(string) string { return "" }
8181
if err := c.loadLongDescription(cmd, "yaml"); err != nil {
8282
return err
8383
}

clidocstool_yaml_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestGenYamlTree(t *testing.T) {
4040

4141
seen := make(map[string]struct{})
4242

43-
filepath.Walk("fixtures", func(path string, info fs.FileInfo, err error) error {
43+
_ = filepath.Walk("fixtures", func(path string, info fs.FileInfo, _ error) error {
4444
fname := filepath.Base(path)
4545
// ignore dirs and any file that is not a .yaml file
4646
if info.IsDir() || !strings.HasSuffix(fname, ".yaml") {
@@ -60,7 +60,7 @@ func TestGenYamlTree(t *testing.T) {
6060
return nil
6161
})
6262

63-
filepath.Walk(tmpdir, func(path string, info fs.FileInfo, err error) error {
63+
_ = filepath.Walk(tmpdir, func(path string, info fs.FileInfo, _ error) error {
6464
fname := filepath.Base(path)
6565
// ignore dirs and any file that is not a .yaml file
6666
if info.IsDir() || !strings.HasSuffix(fname, ".yaml") {

0 commit comments

Comments
 (0)