From 2b7d1e6659336558104e3ff2348c49826dc6fb90 Mon Sep 17 00:00:00 2001 From: xieyanke Date: Tue, 1 May 2018 22:10:20 +0800 Subject: [PATCH] bugfix: fix the output file is used incorrectly. test: fix the wrong test case name. --- pkg/exec/exec.go | 2 +- pkg/utils/utils_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/exec/exec.go b/pkg/exec/exec.go index 8a689d0e2..66523a24f 100644 --- a/pkg/exec/exec.go +++ b/pkg/exec/exec.go @@ -66,7 +66,7 @@ func (p *Process) Start() error { err error ) if p.Output != "" { - if file, err = os.OpenFile(p.Path, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666); err != nil { + if file, err = os.OpenFile(p.Output, os.O_CREATE|os.O_APPEND|os.O_RDWR, 0666); err != nil { return errors.Wrap(err, "failed to open file") } p.file = file diff --git a/pkg/utils/utils_test.go b/pkg/utils/utils_test.go index c48267412..07a80f2bc 100644 --- a/pkg/utils/utils_test.go +++ b/pkg/utils/utils_test.go @@ -241,7 +241,7 @@ func TestDeDuplicate(t *testing.T) { want: []string{"asdfgh01", "asdfgh02", "asdfgh03", "asdfgh04"}, }, { - name: "case with no duplicated", + name: "case with two duplicated", args: args{ input: []string{"asdfgh01", "asdfgh02", "asdfgh01"}, },