Skip to content

Commit

Permalink
Reflect comments
Browse files Browse the repository at this point in the history
Signed-off-by: Daichi Sakaue <[email protected]>
  • Loading branch information
yokaze committed Oct 16, 2024
1 parent 31822e4 commit 5bb2a0b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ func runList(ctx context.Context, w io.Writer, name string) error {
}
}
for _, p := range policyList {
_, err := tw.Write([]byte(fmt.Sprintf("%v\t%v\t%v\t%v\n", p.Direction, p.Kind, p.Namespace, p.Name)))
if err != nil {
if _, err := tw.Write([]byte(fmt.Sprintf("%v\t%v\t%v\t%v\n", p.Direction, p.Kind, p.Namespace, p.Name))); err != nil {
return err
}
}
Expand Down
9 changes: 4 additions & 5 deletions e2e/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@ func runCommand(path string, input []byte, args ...string) ([]byte, []byte, erro
if input != nil {
cmd.Stdin = bytes.NewReader(input)
}
err := cmd.Run()
if err == nil {
return stdout.Bytes(), stderr.Bytes(), nil
if err := cmd.Run(); err != nil {
_, file := filepath.Split(path)
return stdout.Bytes(), stderr.Bytes(), fmt.Errorf("%s failed with %s: stderr=%s", file, err, stderr)
}
_, file := filepath.Split(path)
return stdout.Bytes(), stderr.Bytes(), fmt.Errorf("%s failed with %s: stderr=%s", file, err, stderr)
return stdout.Bytes(), stderr.Bytes(), nil
}

func kubectl(input []byte, args ...string) ([]byte, []byte, error) {
Expand Down

0 comments on commit 5bb2a0b

Please sign in to comment.