Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
srebhan committed Jun 1, 2023
1 parent e2db754 commit d33d2fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
9 changes: 2 additions & 7 deletions cmd/telegraf/cmd_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
"github.com/urfave/cli/v2"
)

func getConfigCommands(m App, pluginFilterFlags []cli.Flag, outputBuffer io.Writer) []*cli.Command {
func getConfigCommands(pluginFilterFlags []cli.Flag, outputBuffer io.Writer) []*cli.Command {
return []*cli.Command{
{
Name: "config",
Expand Down Expand Up @@ -161,12 +161,7 @@ To migrate the file 'mysettings.conf' use
}

// Write the output file
file, err := os.Create(outfn)
if err != nil {
return fmt.Errorf("opening output %q failed: %w", outfn, err)
}
defer file.Close()
if _, err := file.Write(out); err != nil {
if err := os.WriteFile(outfn, out, 0640); err != nil {
return fmt.Errorf("writing output %q failed: %w", outfn, err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/telegraf/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func runApp(args []string, outputBuffer io.Writer, pprof Server, c TelegrafConfi
}

commands := append(
getConfigCommands(m, pluginFilterFlags, outputBuffer),
getConfigCommands(pluginFilterFlags, outputBuffer),
getSecretStoreCommands(m)...,
)

Expand Down

0 comments on commit d33d2fb

Please sign in to comment.