go1.24: fix lint, unit and system tests

- development env: base on debian trixie with go1.24
- lint: run with default config
- fix lint errors
- fix unit tests
- fix system test
This commit is contained in:
André Roth
2025-04-12 17:53:48 +02:00
parent ae5379d84a
commit f7057a9517
117 changed files with 803 additions and 727 deletions
+6 -8
View File
@@ -12,20 +12,18 @@ import (
"github.com/aptly-dev/aptly/utils"
"github.com/aws/aws-sdk-go-v2/aws"
v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4"
signer "github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/logging"
"github.com/pkg/errors"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
)
const errCodeNotFound = "NotFound"
type logger struct{}
func (l *logger) Logf(classification logging.Classification, format string, v ...interface{}) {
@@ -90,7 +88,7 @@ func NewPublishedStorageRaw(
result := &PublishedStorage{
s3: s3.NewFromConfig(*config, func(o *s3.Options) {
o.UsePathStyle = !forceVirtualHostedStyle
o.HTTPSignerV4 = v4.NewSigner()
o.HTTPSignerV4 = signer.NewSigner()
o.BaseEndpoint = baseEndpoint
}),
bucket: bucket,
@@ -149,7 +147,7 @@ func NewPublishedStorage(
return result, err
}
// String
// String returns the storage as string
func (storage *PublishedStorage) String() string {
return fmt.Sprintf("S3: %s:%s/%s", storage.config.Region, storage.bucket, storage.prefix)
}
@@ -170,7 +168,7 @@ func (storage *PublishedStorage) PutFile(path string, sourceFilename string) err
if err != nil {
return err
}
defer source.Close()
defer func() { _ = source.Close() }()
log.Debug().Msgf("S3: PutFile '%s'", path)
err = storage.putFile(path, source, "")
@@ -385,7 +383,7 @@ func (storage *PublishedStorage) LinkFromPool(publishedPrefix, publishedRelPath,
if err != nil {
return err
}
defer source.Close()
defer func() { _ = source.Close() }()
log.Debug().Msgf("S3: LinkFromPool '%s'", relPath)
err = storage.putFile(relPath, source, sourceMD5)