mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-26 06:37:07 +00:00
style: fix remaining golangci-lint findings
This commit is contained in:
@@ -102,7 +102,7 @@ func (fs *FilesystemStorage) Put(ctx context.Context, key string, data io.Reader
|
||||
metrics.RecordStorageOperation("filesystem", "put", "error")
|
||||
return errors.Wrap(err, errors.ErrCodeStorageFailure, "failed to open storage root")
|
||||
}
|
||||
defer root.Close() // #nosec G307 -- Best-effort cleanup of opened storage root
|
||||
defer func() { _ = root.Close() }()
|
||||
|
||||
// Create directory
|
||||
if dir != "." {
|
||||
|
||||
@@ -140,7 +140,7 @@ func (s *Storage) Put(ctx context.Context, key string, data io.Reader, opts *sto
|
||||
s.logger.Warn().Err(err).Str("path", s.path).Msg("nfs: failed to open configured base; skipping fsync")
|
||||
return nil
|
||||
}
|
||||
defer root.Close() // #nosec G307 -- Best-effort cleanup of opened NFS root
|
||||
defer func() { _ = root.Close() }()
|
||||
f, err := root.OpenFile(relPath, os.O_RDWR, 0)
|
||||
if err != nil {
|
||||
s.logger.Warn().Err(err).Str("key", key).Msg("nfs: post-put open failed; skipping fsync")
|
||||
|
||||
@@ -27,8 +27,8 @@ func (s *S3StorageTestSuite) TestNewS3Storage() {
|
||||
Region: "us-east-1",
|
||||
Bucket: "test-bucket",
|
||||
Prefix: "packages/",
|
||||
AccessKeyID: "AKIAIOSFODNN7EXAMPLE",
|
||||
SecretAccessKey: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
|
||||
AccessKeyID: "test-access-key-id",
|
||||
SecretAccessKey: "test-secret-access-key",
|
||||
MaxSizeBytes: 1024 * 1024,
|
||||
},
|
||||
expectError: false,
|
||||
|
||||
Reference in New Issue
Block a user