From 9ee80e3e5426821f03a4e99fad34418f5c736413 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Wed, 10 Dec 2014 05:10:26 -0500 Subject: fix compile error --- modules/base/tool.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'modules/base') diff --git a/modules/base/tool.go b/modules/base/tool.go index 3c435fbdb1..ff5a4f4cd9 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -11,7 +11,6 @@ import ( "crypto/sha1" "encoding/base64" "encoding/hex" - "errors" "fmt" "hash" "html/template" @@ -41,15 +40,14 @@ func EncodeSha1(str string) string { return hex.EncodeToString(h.Sum(nil)) } -func BasicAuthDecode(encoded string) (user string, name string, err error) { - var s []byte - s, err = base64.StdEncoding.DecodeString(encoded) +func BasicAuthDecode(encoded string) (string, string, error) { + s, err := base64.StdEncoding.DecodeString(encoded) if err != nil { - return user, name, err + return "", "", err } auth := strings.SplitN(string(s), ":", 2) - return auth[0], auth[1], err + return auth[0], auth[1], nil } func BasicAuthEncode(username, password string) string { -- cgit v1.2.3