aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdülhamit Yilmaz <mr.yilmaz@gmx.de>2015-03-17 21:25:18 +0300
committerAbdülhamit Yilmaz <mr.yilmaz@gmx.de>2015-03-17 21:25:18 +0300
commit5ce09b9e8fa7c321ae9de4ad85f08a1b372e9fdf (patch)
treedb74372a567d9f1e4657cc9572d2ce5019b9cb63
parent5f171f42328bdd573211bb82bdee8f259c4c61ae (diff)
Omit unnecessary `else`s
See http://golang.org/doc/effective_go.html#else
-rw-r--r--securecookie.go12
1 files changed, 6 insertions, 6 deletions
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
}