mirror of
https://github.com/gogs/gogs.git
synced 2025-12-22 16:20:14 +01:00
ci: enable go vet check (#5981)
* ci: enable go vet check * Improve .travis.yml
This commit is contained in:
@@ -695,7 +695,7 @@ func LoginViaSMTP(user *User, login, password string, sourceID int64, cfg *SMTPC
|
||||
tperr, ok := err.(*textproto.Error)
|
||||
if (ok && tperr.Code == 535) ||
|
||||
strings.Contains(err.Error(), "Username and Password not accepted") {
|
||||
return nil, errors.UserNotExist{0, login}
|
||||
return nil, errors.UserNotExist{Name: login}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
@@ -735,7 +735,7 @@ func LoginViaSMTP(user *User, login, password string, sourceID int64, cfg *SMTPC
|
||||
func LoginViaPAM(user *User, login, password string, sourceID int64, cfg *PAMConfig, autoRegister bool) (*User, error) {
|
||||
if err := pam.PAMAuth(cfg.ServiceName, login, password); err != nil {
|
||||
if strings.Contains(err.Error(), "Authentication failure") {
|
||||
return nil, errors.UserNotExist{0, login}
|
||||
return nil, errors.UserNotExist{Name: login}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
@@ -768,7 +768,7 @@ func LoginViaGitHub(user *User, login, password string, sourceID int64, cfg *Git
|
||||
fullname, email, url, location, err := github.Authenticate(cfg.APIEndpoint, login, password)
|
||||
if err != nil {
|
||||
if strings.Contains(err.Error(), "401") {
|
||||
return nil, errors.UserNotExist{0, login}
|
||||
return nil, errors.UserNotExist{Name: login}
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
@@ -840,7 +840,7 @@ func UserLogin(username, password string, loginSourceID int64) (*User, error) {
|
||||
return user, nil
|
||||
}
|
||||
|
||||
return nil, errors.UserNotExist{user.ID, user.Name}
|
||||
return nil, errors.UserNotExist{UserID: user.ID, Name: user.Name}
|
||||
}
|
||||
|
||||
// Remote login to the login source the user is associated with
|
||||
@@ -854,7 +854,7 @@ func UserLogin(username, password string, loginSourceID int64) (*User, error) {
|
||||
|
||||
// Non-local login source is always greater than 0
|
||||
if loginSourceID <= 0 {
|
||||
return nil, errors.UserNotExist{-1, username}
|
||||
return nil, errors.UserNotExist{UserID: -1, Name: username}
|
||||
}
|
||||
|
||||
source, err := GetLoginSourceByID(loginSourceID)
|
||||
|
||||
Reference in New Issue
Block a user