From 2881292427531f06984f6b198aa72b4eba0bdc75 Mon Sep 17 00:00:00 2001 From: Ron Wolf Date: Thu, 13 Jun 2019 13:40:11 -0400 Subject: [PATCH] Remove redundant nil check Lack of JSON encode error will produce & return nil regardless --- pkg/cli/stats.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/cli/stats.go b/pkg/cli/stats.go index a9e72b82..6fa62b54 100644 --- a/pkg/cli/stats.go +++ b/pkg/cli/stats.go @@ -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"))