]> source.dussan.org Git - gitea.git/commitdiff
remove unused code in BasicAuthDecode
authorMageti <etienne@mageti.fr>
Wed, 10 Dec 2014 10:01:17 +0000 (11:01 +0100)
committerMageti <etienne@mageti.fr>
Wed, 10 Dec 2014 10:01:17 +0000 (11:01 +0100)
modules/base/tool.go

index 39d3e8abdcfc1c59e430b8127a800bf65dbf6a7f..3c435fbdb1c38ddd939c17bc30b3a529a9cf5007 100644 (file)
@@ -48,13 +48,8 @@ func BasicAuthDecode(encoded string) (user string, name string, err error) {
                return user, name, err
        }
 
-       a := strings.SplitN(string(s), ":", 2)
-       if len(a) != 2 {
-               err = errors.New("decode failed")
-       } else {
-               user, name = a[0], a[1]
-       }
-       return user, name, err
+       auth := strings.SplitN(string(s), ":", 2)
+       return auth[0], auth[1], err
 }
 
 func BasicAuthEncode(username, password string) string {