From 346c4e7286f4a8fab9c035a7c7092856b4ce8339 Mon Sep 17 00:00:00 2001 From: Mark Laing Date: Tue, 17 Dec 2024 17:53:41 +0000 Subject: [PATCH 1/4] lxd-agent: Remove defunct lint exceptions. Signed-off-by: Mark Laing --- lxd-agent/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxd-agent/main.go b/lxd-agent/main.go index 54b24d5b6953..209a0964d065 100644 --- a/lxd-agent/main.go +++ b/lxd-agent/main.go @@ -46,6 +46,6 @@ func main() { err := app.Execute() if err != nil { // Ensure we exit with a non-zero exit code. - os.Exit(1) //nolint:revive + os.Exit(1) } } From b5a2e88c9ac8703253a640431ceb328a26678437 Mon Sep 17 00:00:00 2001 From: Mark Laing Date: Tue, 17 Dec 2024 17:53:56 +0000 Subject: [PATCH 2/4] lxd/db/cluster: Remove defunct lint exceptions. Signed-off-by: Mark Laing --- lxd/db/cluster/entities.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lxd/db/cluster/entities.go b/lxd/db/cluster/entities.go index 01e807234b96..cd23eedfaeba 100644 --- a/lxd/db/cluster/entities.go +++ b/lxd/db/cluster/entities.go @@ -246,7 +246,7 @@ func GetEntityURL(ctx context.Context, tx *sql.Tx, entityType entity.Type, entit // This method combines the above queries into a single query using the UNION operator. If no entity types are given, this function will // return URLs for all entity types. If no project name is given, this function will return URLs for all projects. This may result in // stupendously large queries, so use with caution! -func GetEntityURLs(ctx context.Context, tx *sql.Tx, projectName string, filteringEntityTypes ...entity.Type) (map[entity.Type]map[int]*api.URL, error) { //nolint:unused // This will be used in a forthcoming feature. +func GetEntityURLs(ctx context.Context, tx *sql.Tx, projectName string, filteringEntityTypes ...entity.Type) (map[entity.Type]map[int]*api.URL, error) { var stmts []string var args []any result := make(map[entity.Type]map[int]*api.URL) From 3815b27e9662fde6dc23d68387d07b7030383614 Mon Sep 17 00:00:00 2001 From: Mark Laing Date: Tue, 17 Dec 2024 17:54:15 +0000 Subject: [PATCH 3/4] lxd: Remove defunct lint exceptions. Signed-off-by: Mark Laing --- lxd/api_internal_recover.go | 2 +- lxd/instance_test.go | 1 - lxd/operations.go | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lxd/api_internal_recover.go b/lxd/api_internal_recover.go index d02d07b48efe..066b5c9c8278 100644 --- a/lxd/api_internal_recover.go +++ b/lxd/api_internal_recover.go @@ -214,7 +214,7 @@ func internalRecoverScan(s *state.State, userPools []api.StoragePoolsPost, valid // This way if we are dealing with an existing pool or have successfully created the DB record then // we won't unmount it. As we should leave successfully imported pools mounted. if ourMount { - defer func() { //nolint:revive + defer func() { cleanupPool := pools[pool.Name()] if cleanupPool != nil && cleanupPool.ID() == storagePools.PoolIDTemporary { _, _ = cleanupPool.Unmount() diff --git a/lxd/instance_test.go b/lxd/instance_test.go index 5f25dd7d0950..ada5e1713c8a 100644 --- a/lxd/instance_test.go +++ b/lxd/instance_test.go @@ -73,7 +73,6 @@ func (suite *containerTestSuite) TestContainer_ProfilesMulti() { suite.Req.Nil(err, "Failed to create the unprivileged profile.") defer func() { _ = suite.d.db.Cluster.Transaction(context.TODO(), func(ctx context.Context, tx *db.ClusterTx) error { - //nolint:revive // revive seems to think this return is outside of the transaction. return cluster.DeleteProfile(ctx, tx.Tx(), "default", "unprivileged") }) }() diff --git a/lxd/operations.go b/lxd/operations.go index 693dae5e1a42..bea7f5dcae6d 100644 --- a/lxd/operations.go +++ b/lxd/operations.go @@ -69,7 +69,7 @@ func waitForOperations(ctx context.Context, cluster *db.Cluster, consoleShutdown logger.Error("Failed cleaning up operations") } - return nil //nolint:revive // False positive: raises "return in a defer function has no effect". + return nil }) }() From 6fb2c786f39bc540512b3e9f1dbaef0bb8d754c9 Mon Sep 17 00:00:00 2001 From: Mark Laing Date: Tue, 17 Dec 2024 17:54:31 +0000 Subject: [PATCH 4/4] test/mini-oidc/storage: Remove defunct lint exceptions. Signed-off-by: Mark Laing --- test/mini-oidc/storage/storage_dynamic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mini-oidc/storage/storage_dynamic.go b/test/mini-oidc/storage/storage_dynamic.go index 237bb21d2303..4d34c391b83f 100644 --- a/test/mini-oidc/storage/storage_dynamic.go +++ b/test/mini-oidc/storage/storage_dynamic.go @@ -15,7 +15,7 @@ type multiStorage struct { // NewMultiStorage implements the op.Storage interface by wrapping multiple storage structs // and selecting them by the calling issuer. -func NewMultiStorage(issuers []string) *multiStorage { //nolint:revive +func NewMultiStorage(issuers []string) *multiStorage { s := make(map[string]*Storage) for _, issuer := range issuers { s[issuer] = NewStorage(NewUserStore(issuer))