From 1994768441aca24126140075b510dca44e7c3a2b Mon Sep 17 00:00:00 2001 From: Masayuki Morita Date: Tue, 18 Apr 2023 11:17:47 +0900 Subject: [PATCH] Fix lint issues --- cmd/version.go | 2 +- main.go | 3 +-- main_test.go | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/version.go b/cmd/version.go index d0296be..2f93a89 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -25,7 +25,7 @@ func newVersionCmd() *cobra.Command { return cmd } -func runVersionCmd(cmd *cobra.Command, args []string) error { +func runVersionCmd(cmd *cobra.Command, _ []string) error { _, err := fmt.Fprintln(cmd.OutOrStdout(), Version) return err } diff --git a/main.go b/main.go index ad954b9..7be1db2 100644 --- a/main.go +++ b/main.go @@ -3,7 +3,6 @@ package main import ( "fmt" "io" - "io/ioutil" "log" "os" @@ -25,7 +24,7 @@ func logOutput() io.Writer { minLevel := os.Getenv("HCLEDIT_LOG") // default log writer is null device. - writer := ioutil.Discard + writer := io.Discard if minLevel != "" { writer = os.Stderr } diff --git a/main_test.go b/main_test.go index d65ac08..2af34cc 100644 --- a/main_test.go +++ b/main_test.go @@ -154,7 +154,7 @@ func argsToEnv(args []string) []string { func envToArgs(env []string) []string { var envvars []string - for _, kv := range os.Environ() { + for _, kv := range env { if strings.HasPrefix(kv, VarRunMainForTestingArgPrefix) { envvars = append(envvars, kv) }