Skip to content

Commit

Permalink
Remove redundant nil check
Browse files Browse the repository at this point in the history
Lack of JSON encode error will produce & return nil regardless
  • Loading branch information
ron-wolf authored Jun 13, 2019
1 parent b683d56 commit 2881292
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pkg/cli/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,8 @@ func stats(c *cli.Context) error {
}

if c.Bool("json") {
if err := json.NewEncoder(os.Stdout).Encode(result); err != nil {
return err
}

return nil
err := json.NewEncoder(os.Stdout).Encode(result)
return err
}

fmt.Printf("%s - %s\n", start.Format("Jan 01, 2006"), end.Format("Jan 01, 2006"))
Expand Down

0 comments on commit 2881292

Please sign in to comment.