fix compile error
This commit is contained in:
		
							parent
							
								
									b2c6a6920f
								
							
						
					
					
						commit
						9ee80e3e54
					
				
							
								
								
									
										2
									
								
								gogs.go
								
								
								
								
							
							
						
						
									
										2
									
								
								gogs.go
								
								
								
								
							| 
						 | 
					@ -17,7 +17,7 @@ import (
 | 
				
			||||||
	"github.com/gogits/gogs/modules/setting"
 | 
						"github.com/gogits/gogs/modules/setting"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const APP_VER = "0.5.8.1209 Beta"
 | 
					const APP_VER = "0.5.8.1210 Beta"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func init() {
 | 
					func init() {
 | 
				
			||||||
	runtime.GOMAXPROCS(runtime.NumCPU())
 | 
						runtime.GOMAXPROCS(runtime.NumCPU())
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,6 @@ import (
 | 
				
			||||||
	"crypto/sha1"
 | 
						"crypto/sha1"
 | 
				
			||||||
	"encoding/base64"
 | 
						"encoding/base64"
 | 
				
			||||||
	"encoding/hex"
 | 
						"encoding/hex"
 | 
				
			||||||
	"errors"
 | 
					 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"hash"
 | 
						"hash"
 | 
				
			||||||
	"html/template"
 | 
						"html/template"
 | 
				
			||||||
| 
						 | 
					@ -41,15 +40,14 @@ func EncodeSha1(str string) string {
 | 
				
			||||||
	return hex.EncodeToString(h.Sum(nil))
 | 
						return hex.EncodeToString(h.Sum(nil))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func BasicAuthDecode(encoded string) (user string, name string, err error) {
 | 
					func BasicAuthDecode(encoded string) (string, string, error) {
 | 
				
			||||||
	var s []byte
 | 
						s, err := base64.StdEncoding.DecodeString(encoded)
 | 
				
			||||||
	s, err = base64.StdEncoding.DecodeString(encoded)
 | 
					 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return user, name, err
 | 
							return "", "", err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auth := strings.SplitN(string(s), ":", 2)
 | 
						auth := strings.SplitN(string(s), ":", 2)
 | 
				
			||||||
	return auth[0], auth[1], err
 | 
						return auth[0], auth[1], nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func BasicAuthEncode(username, password string) string {
 | 
					func BasicAuthEncode(username, password string) string {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1 +1 @@
 | 
				
			||||||
0.5.8.1209 Beta
 | 
					0.5.8.1210 Beta
 | 
				
			||||||
		Loading…
	
		Reference in New Issue