Skip to content

Commit 0094cf4

Browse files
committed
fix linting issues (revive)
clidocstool_yaml_test.go:63:60: unused-parameter: parameter 'err' seems to be unused, consider removing or renaming it as _ (revive) filepath.Walk(tmpdir, func(path string, info fs.FileInfo, err error) error { ^ clidocstool_man_test.go:80:60: unused-parameter: parameter 'err' seems to be unused, consider removing or renaming it as _ (revive) filepath.Walk(tmpdir, func(path string, info fs.FileInfo, err error) error { ^ clidocstool_test.go:52:31: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive) Run: func(cmd *cobra.Command, args []string) {}, ^ clidocstool_md_test.go:65:60: unused-parameter: parameter 'err' seems to be unused, consider removing or renaming it as _ (revive) filepath.Walk(tmpdir, func(path string, info fs.FileInfo, err error) error { ^ clidocstool_test.go:68:13: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive) Run: func(cmd *cobra.Command, args []string) {}, ^ clidocstool_test.go:89:17: unused-parameter: parameter 'cmd' seems to be unused, consider removing or renaming it as _ (revive) Run: func(cmd *cobra.Command, args []string) {}, ^ clidocstool_yaml.go:80:19: unused-parameter: parameter 's' seems to be unused, consider removing or renaming it as _ (revive) emptyStr := func(s string) string { return "" } ^ Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent a33364e commit 0094cf4

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

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)