From 2effc235f3a42f242c6e8c02ff6369dd16299191 Mon Sep 17 00:00:00 2001 From: yunlzheng Date: Sat, 22 Feb 2020 20:56:26 +0800 Subject: [PATCH] fixed unused variable code issue --- pkg/kt/exec/run.go | 6 +++--- test/integration/command_check_test.go | 13 +++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pkg/kt/exec/run.go b/pkg/kt/exec/run.go index 3614d53..6c2f674 100644 --- a/pkg/kt/exec/run.go +++ b/pkg/kt/exec/run.go @@ -34,14 +34,14 @@ func runCmd(cmd *exec.Cmd, name string, debug bool) (err error) { var stdoutBuf, stderrBuf bytes.Buffer stdoutIn, _ := cmd.StdoutPipe() stderrIn, _ := cmd.StderrPipe() - var errStdout, errStderr error + // var errStdout, errStderr error stdout := io.MultiWriter(os.Stdout, &stdoutBuf) stderr := io.MultiWriter(os.Stderr, &stderrBuf) go func() { - _, errStdout = io.Copy(stdout, stdoutIn) + _, _ = io.Copy(stdout, stdoutIn) }() go func() { - _, errStderr = io.Copy(stderr, stderrIn) + _, _ = io.Copy(stderr, stderrIn) }() err = cmd.Start() diff --git a/test/integration/command_check_test.go b/test/integration/command_check_test.go index 096d413..db21baf 100644 --- a/test/integration/command_check_test.go +++ b/test/integration/command_check_test.go @@ -2,20 +2,21 @@ package integration import ( "testing" - "github.com/urfave/cli" - "github.com/alibaba/kt-connect/pkg/kt/options" + "github.com/alibaba/kt-connect/pkg/kt/command" + "github.com/alibaba/kt-connect/pkg/kt/options" + "github.com/urfave/cli" ) -func Test_should(t *testing.T) { +func Test_shouldCheckLocalDenpendencies(t *testing.T) { args := []string{"ktctl", "check"} options := options.NewDaemonOptions() app := cli.NewApp() - app.Commands = []cli.Command { + app.Commands = []cli.Command{ command.NewCheckCommand(options), - } + } err := app.Run(args) if err != nil { t.Errorf("%s failed: %v", args, err) } -} \ No newline at end of file +}