Skip to content

Commit

Permalink
Add error check
Browse files Browse the repository at this point in the history
  • Loading branch information
nao1215 committed Nov 26, 2022
1 parent 58c14ae commit a2bf9e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion config/argument_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ func getStdout(t *testing.T, f func()) string {
Stdout = backupColorStdout
}()

r, w, _ := os.Pipe()
r, w, err := os.Pipe()
if err != nil {
t.Fatal(err)
}
Stdout = w

f()
Expand Down
10 changes: 8 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,10 @@ func getStdoutForRunFunc(t *testing.T, f func([]string) int, list []string) []by
config.Stdout = backupColorStdout
}()

r, w, _ := os.Pipe()
r, w, err := os.Pipe()
if err != nil {
t.Fatal(err)
}
config.Stdout = w

f(list)
Expand All @@ -127,7 +130,10 @@ func getStdout(t *testing.T, f func()) []byte {
config.Stdout = backupColorStdout
}()

r, w, _ := os.Pipe()
r, w, err := os.Pipe()
if err != nil {
t.Fatal(err)
}
config.Stdout = w

f()
Expand Down

0 comments on commit a2bf9e7

Please sign in to comment.