Skip to content

Commit

Permalink
fix linting issues (revive)
Browse files Browse the repository at this point in the history
    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]>
  • Loading branch information
thaJeztah committed Dec 13, 2024
1 parent a33364e commit 0094cf4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions clidocstool_man_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func TestGenManTree(t *testing.T) {
seen := make(map[string]struct{})
remanpage := regexp.MustCompile(`\.\d+$`)

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

filepath.Walk(tmpdir, func(path string, info fs.FileInfo, err error) error {
_ = filepath.Walk(tmpdir, func(path string, info fs.FileInfo, _ error) error {
fname := filepath.Base(path)
// ignore dirs and any file that is not a manpage
if info.IsDir() || !remanpage.MatchString(fname) {
Expand Down
4 changes: 2 additions & 2 deletions clidocstool_md_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestGenMarkdownTree(t *testing.T) {

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

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

filepath.Walk(tmpdir, func(path string, info fs.FileInfo, err error) error {
_ = filepath.Walk(tmpdir, func(path string, info fs.FileInfo, _ error) error {
fname := filepath.Base(path)
// ignore dirs, .pre.md files and any file that is not a .md file
if info.IsDir() || !strings.HasSuffix(fname, ".md") || strings.HasSuffix(fname, ".pre.md") {
Expand Down
16 changes: 8 additions & 8 deletions clidocstool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func setup() {
SilenceUsage: true,
SilenceErrors: true,
TraverseChildren: true,
Run: func(cmd *cobra.Command, args []string) {},
Run: func(*cobra.Command, []string) {},
Version: "20.10.8",
DisableFlagsInUseLine: true,
}
Expand All @@ -65,7 +65,7 @@ func setup() {
Annotations: map[string]string{
"aliases": "docker container attach, docker attach",
},
Run: func(cmd *cobra.Command, args []string) {},
Run: func(*cobra.Command, []string) {},
}

attachFlags := attachCmd.Flags()
Expand All @@ -86,7 +86,7 @@ func setup() {
Use: "build [OPTIONS] PATH | URL | -",
Aliases: []string{"b"},
Short: "Start a build",
Run: func(cmd *cobra.Command, args []string) {},
Run: func(*cobra.Command, []string) {},
Annotations: map[string]string{
"aliases": "docker image build, docker buildx build, docker buildx b, docker build",
},
Expand All @@ -95,19 +95,19 @@ func setup() {
Use: "dial-stdio",
Short: "Proxy current stdio streams to builder instance",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {},
Run: func(*cobra.Command, []string) {},
}
buildxInstallCmd = &cobra.Command{
Use: "install",
Short: "Install buildx as a 'docker builder' alias",
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {},
Run: func(*cobra.Command, []string) {},
Hidden: true,
}
buildxStopCmd = &cobra.Command{
Use: "stop [NAME]",
Short: "Stop builder instance",
Run: func(cmd *cobra.Command, args []string) {},
Run: func(*cobra.Command, []string) {},
}

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

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

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

filepath.Walk(tmpdir, func(path string, info fs.FileInfo, err error) error {
_ = filepath.Walk(tmpdir, func(path string, info fs.FileInfo, _ error) error {
fname := filepath.Base(path)
// ignore dirs and .pre.md files
if info.IsDir() || strings.HasSuffix(fname, ".pre.md") {
Expand Down
2 changes: 1 addition & 1 deletion clidocstool_yaml.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ type cmdDoc struct {
// subcmds, `sub` and `sub-third`, and `sub` has a subcommand called `third`
// it is undefined which help output will be in the file `cmd-sub-third.1`.
func (c *Client) GenYamlTree(cmd *cobra.Command) error {
emptyStr := func(s string) string { return "" }
emptyStr := func(string) string { return "" }
if err := c.loadLongDescription(cmd, "yaml"); err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions clidocstool_yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func TestGenYamlTree(t *testing.T) {

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

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

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

0 comments on commit 0094cf4

Please sign in to comment.