Chore: Enable exhaustive linter (#29458)

* Chore: Enable exhaustive linter

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen
2020-12-01 09:53:27 +01:00
committed by GitHub
parent cbb2c0a5d8
commit f55818ca70
16 changed files with 37 additions and 16 deletions
@@ -138,6 +138,8 @@ func (hc *HipChatNotifier) Notify(evalContext *alerting.EvalContext) error {
color = "gray"
case models.AlertStateAlerting:
color = "red"
default:
// Handle other cases?
}
// Add a card with link to the dashboard
@@ -99,6 +99,8 @@ func (on *OpsGenieNotifier) Notify(evalContext *alerting.EvalContext) error {
}
case models.AlertStateAlerting:
err = on.createAlert(evalContext)
default:
// Handle other cases?
}
return err
}
@@ -127,6 +127,8 @@ func (notifier *ThreemaNotifier) Notify(evalContext *alerting.EvalContext) error
stateEmoji = "\u2753\uFE0F " // Question Mark
case models.AlertStateAlerting:
stateEmoji = "\u26A0\uFE0F " // Warning sign
default:
// Handle other cases?
}
// Build message
+2
View File
@@ -444,6 +444,8 @@ func (sc *scenarioContext) verifyUpdateDashboardPermissionsShouldNotBeAllowed(pt
newDefaultUserPermission(dashboardID, p),
newCustomTeamPermission(dashboardID, otherTeamID, p),
}...)
default:
// TODO: Handle other cases?
}
sc.updatePermissions = permissionList
+2
View File
@@ -286,5 +286,7 @@ func handleLog(msg centrifuge.LogEntry) {
loggerCF.Error(msg.Message, arr...)
case centrifuge.LogLevelInfo:
loggerCF.Info(msg.Message, arr...)
case centrifuge.LogLevelNone:
loggerCF.Debug(msg.Message, arr...)
}
}
-1
View File
@@ -40,7 +40,6 @@ func (ls *LoginService) UpsertUser(cmd *models.UpsertUserCommand) error {
Email: extUser.Email,
Login: extUser.Login,
}
if err := bus.Dispatch(userQuery); err != nil {
if !errors.Is(err, models.ErrUserNotFound) {
return err
+2
View File
@@ -232,6 +232,8 @@ func (rs *RenderingService) getURL(path string) string {
protocol = "http"
case setting.HTTP2Scheme, setting.HTTPSScheme:
protocol = "https"
default:
// TODO: Handle other schemes?
}
subPath := ""
+5 -5
View File
@@ -232,7 +232,6 @@ func verifyExistingOrg(sess *DBSession, orgId int64) error {
func getOrCreateOrg(sess *DBSession, orgName string) (int64, error) {
var org models.Org
if setting.AutoAssignOrg {
has, err := sess.Where("id=?", setting.AutoAssignOrgId).Get(&org)
if err != nil {
@@ -241,15 +240,16 @@ func getOrCreateOrg(sess *DBSession, orgName string) (int64, error) {
if has {
return org.Id, nil
}
if setting.AutoAssignOrgId == 1 {
org.Name = mainOrgName
org.Id = int64(setting.AutoAssignOrgId)
} else {
if setting.AutoAssignOrgId != 1 {
sqlog.Error("Could not create user: organization ID does not exist", "orgID",
setting.AutoAssignOrgId)
return 0, fmt.Errorf("could not create user: organization ID %d does not exist",
setting.AutoAssignOrgId)
}
org.Name = mainOrgName
org.Id = int64(setting.AutoAssignOrgId)
} else {
org.Name = orgName
}