From 71a9c0834b6fe637b9d6920103649631f450726c Mon Sep 17 00:00:00 2001 From: bogem Date: Tue, 30 Aug 2016 21:57:12 +0500 Subject: [PATCH] Simplify condition with err --- bash_completions.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bash_completions.go b/bash_completions.go index c9b43d9..7a5bd4d 100644 --- a/bash_completions.go +++ b/bash_completions.go @@ -401,10 +401,8 @@ func writeLocalNonPersistentFlag(flag *pflag.Flag, w io.Writer) error { format += "=" } format += "\")\n" - if _, err := fmt.Fprintf(w, format, name); err != nil { - return err - } - return nil + _, err := fmt.Fprintf(w, format, name) + return err } func writeFlags(cmd *Command, w io.Writer) error {