Simplify error handling on function return

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
Mrunal Patel
2017-01-06 15:57:31 -08:00
parent 1a9dd2678d
commit 84a3bd250c
4 changed files with 4 additions and 17 deletions
+1 -4
View File
@@ -39,10 +39,7 @@ var psCommand = cli.Command{
}
if context.String("format") == "json" {
if err := json.NewEncoder(os.Stdout).Encode(pids); err != nil {
return err
}
return nil
return json.NewEncoder(os.Stdout).Encode(pids)
}
// [1:] is to remove command name, ex: