Add staticcheck fixes (#3221)

* Add staticcheck fixes

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

* update golangci-lint version

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>

---------

Signed-off-by: Sanket Sudake <sanketsudake@gmail.com>
This commit is contained in:
Sanket Sudake
2025-05-18 22:27:45 +05:30
committed by GitHub
parent 6cc6498844
commit 2b13af0a5e
58 changed files with 228 additions and 226 deletions
+2 -2
View File
@@ -293,7 +293,7 @@ func Start(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *
// create a storage client
storageClient, err := MakeStowClient(logger, storage)
if err != nil {
return fmt.Errorf("Error creating stowClient: %w", err)
return fmt.Errorf("error creating stowClient: %w", err)
}
// create http handlers
@@ -315,7 +315,7 @@ func Start(ctx context.Context, clientGen crd.ClientGeneratorInterface, logger *
}
pruner, err := MakeArchivePruner(logger, clientGen, storageClient, time.Duration(pruneInterval))
if err != nil {
return fmt.Errorf("Error creating archivePruner: %w", err)
return fmt.Errorf("error creating archivePruner: %w", err)
}
mgr.Add(ctx, func(ctx context.Context) {
pruner.Start(ctx, mgr)
+3 -3
View File
@@ -53,7 +53,7 @@ const (
// StorageTypeS3 is a constant to hold S3 storage type name literal
StorageTypeS3 StorageType = "s3"
// PaginationSize is a constant to hold no of pages
PaginationSize int = 10
PaginationSize = 10
)
var (
@@ -96,7 +96,7 @@ func getOrCreateContainer(loc stow.Location, containerName string, cursor string
con, err = getContainer(loc, containerName, stow.CursorStart)
}
if con == nil && err == nil {
err = fmt.Errorf("Storage container %s not found", containerName)
err = fmt.Errorf("storage container %s not found", containerName)
}
return con, err
}
@@ -105,7 +105,7 @@ func getOrCreateContainer(loc stow.Location, containerName string, cursor string
func MakeStowClient(logger *zap.Logger, storage Storage) (*StowClient, error) {
storageType := getStorageType(storage)
if strings.Compare(storageType, "local") == 1 && strings.Compare(storageType, "s3") == 1 {
return nil, errors.New("Storage types other than 'local' and 's3' are not implemented")
return nil, errors.New("storage types other than 'local' and 's3' are not implemented")
}
config := &storageConfig{