Chore: Enable goprintffuncname and nakedret linters (#26376)

* Chore: Enable goprintffuncname linter
* Chore: Enable nakedret linter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-07-23 08:14:39 +02:00
committed by GitHub
parent 9b17fe436c
commit 4c56eb3991
22 changed files with 53 additions and 51 deletions
+1 -1
View File
@@ -265,7 +265,7 @@ func appendIfPossible(message string, extra string, sizeLimit int) string {
if len(extra)+len(message) <= sizeLimit {
return message + extra
}
log.Debug("Line too long for image caption. value: %s", extra)
log.Debugf("Line too long for image caption. value: %s", extra)
return message
}
+2 -2
View File
@@ -44,13 +44,13 @@ func (ls *LoginService) UpsertUser(cmd *models.UpsertUserCommand) error {
return err
}
if !cmd.SignupAllowed {
log.Warn("Not allowing %s login, user not found in internal user database and allow signup = false", extUser.AuthModule)
log.Warnf("Not allowing %s login, user not found in internal user database and allow signup = false", extUser.AuthModule)
return ErrInvalidCredentials
}
limitReached, err := ls.QuotaService.QuotaReached(cmd.ReqContext, "user")
if err != nil {
log.Warn("Error getting user quota. error: %v", err)
log.Warnf("Error getting user quota. error: %v", err)
return ErrGettingUserQuota
}
if limitReached {
+1 -1
View File
@@ -66,7 +66,7 @@ func inTransactionWithRetryCtx(ctx context.Context, engine *xorm.Engine, callbac
if len(sess.events) > 0 {
for _, e := range sess.events {
if err = bus.Publish(e); err != nil {
log.Error(3, "Failed to publish event after commit. error: %v", err)
log.Errorf(3, "Failed to publish event after commit. error: %v", err)
}
}
}