From 5ce09b9e8fa7c321ae9de4ad85f08a1b372e9fdf Mon Sep 17 00:00:00 2001 From: Abdülhamit Yilmaz Date: Tue, 17 Mar 2015 19:25:18 +0100 Subject: Omit unnecessary `else`s See http://golang.org/doc/effective_go.html#else --- securecookie.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'securecookie.go') diff --git a/securecookie.go b/securecookie.go index 620c508..a76083b 100644 --- a/securecookie.go +++ b/securecookie.go @@ -375,11 +375,11 @@ func EncodeMulti(name string, value interface{}, codecs ...Codec) (string, error var errors MultiError for _, codec := range codecs { - if encoded, err := codec.Encode(name, value); err == nil { + encoded, err := codec.Encode(name, value) + if err == nil { return encoded, nil - } else { - errors = append(errors, err) } + errors = append(errors, err) } return "", errors } @@ -395,11 +395,11 @@ func DecodeMulti(name string, value string, dst interface{}, codecs ...Codec) er var errors MultiError for _, codec := range codecs { - if err := codec.Decode(name, value, dst); err == nil { + err := codec.Decode(name, value, dst) + if err == nil { return nil - } else { - errors = append(errors, err) } + errors = append(errors, err) } return errors } -- cgit v1.2.3