[v9.3.x] CI: Update golangci-lint to 1.51.2 for Go 1.20 compatibility (#65506)

[v9.3.x] Update golangci-lint to 1.51.2 for Go 1.20 compatibility
This commit is contained in:
Horst Gutmann
2023-03-29 10:42:59 +02:00
committed by GitHub
parent 972a9c5957
commit 64f074ca8d
18 changed files with 181 additions and 15 deletions
@@ -73,6 +73,7 @@ func (nps *NotificationPolicyService) UpdatePolicyTree(ctx context.Context, orgI
return err
}
//nolint:staticcheck // fixed in main
receivers, err := nps.receiversToMap(revision.cfg.AlertmanagerConfig.Receivers)
err = tree.ValidateReceivers(receivers)
if err != nil {
@@ -151,6 +151,7 @@ func (m dashboardPermissionsMigrator) migratePermissions(dashboards []dashboard,
return fmt.Errorf("failed to bulk-create roles: %w", err)
}
//nolint:gosimple // fixed in main
for i := range createdRoles {
allRoles = append(allRoles, createdRoles[i])
}
+3
View File
@@ -64,6 +64,9 @@ func TestRetryingOnFailures(t *testing.T) {
sess := store.GetSqlxSession()
rows, err := sess.Query(context.Background(), `SELECT "hello",2.3,4`)
require.NoError(t, err)
defer func() {
require.NoError(t, rows.Close())
}()
require.True(t, rows.Next()) // first row
str1 := ""
@@ -506,6 +506,7 @@ func (s *sqlObjectServer) fillCreationInfo(ctx context.Context, tx *session.Sess
err = rows.Scan(&createdAt, &createdBy)
}
if err == nil {
//nolint:sqlclosecheck
err = rows.Close()
}
}
@@ -526,6 +527,7 @@ func (s *sqlObjectServer) selectForUpdate(ctx context.Context, tx *session.Sessi
err = rows.Scan(&current.ETag, &current.Version, &current.UpdatedAt, &current.Size)
}
if err == nil {
//nolint:sqlclosecheck
err = rows.Close()
}
return current, err