Apply mechanical lint fixes for golangci-lint v2.12.2 rollout

Auto-remediate style-only findings (wsl_v5, nlreturn, noinlineerr,
modernize, intrange, perfsprint, usetesting, unconvert, errorlint,
gocritic, testifylint) and rename printf-style helpers to f-suffixed
names (goprintffuncname): ui.Writer message methods, cli.ReportErrorf,
database.Fatalf, vaultik stdoutf.
This commit is contained in:
2026-08-07 17:01:52 +00:00
parent 23d22a0f19
commit 6cf9211407
110 changed files with 2566 additions and 722 deletions

View File

@@ -57,7 +57,8 @@ func NewTestServer(t *testing.T) *TestServer {
// Start server in background
go func() {
if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
err := server.ListenAndServe()
if err != nil && err != http.ErrServerClosed {
t.Logf("test server error: %v", err)
}
}()
@@ -77,7 +78,7 @@ func NewTestServer(t *testing.T) *TestServer {
"",
)),
config.WithClientLogMode(aws.LogRetries|aws.LogRequestWithBody|aws.LogResponseWithBody),
config.WithLogger(logging.LoggerFunc(func(classification logging.Classification, format string, v ...interface{}) {
config.WithLogger(logging.LoggerFunc(func(classification logging.Classification, format string, v ...any) {
// Capture logs to buffer instead of stdout
fmt.Fprintf(logBuf, "SDK %s %s %s\n",
time.Now().Format("2006/01/02 15:04:05"),
@@ -125,7 +126,8 @@ func (ts *TestServer) Cleanup() error {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
if err := ts.server.Shutdown(ctx); err != nil {
err := ts.server.Shutdown(ctx)
if err != nil {
return err
}
@@ -141,7 +143,8 @@ func (ts *TestServer) Client() *s3.Client {
func TestBasicS3Operations(t *testing.T) {
ts := NewTestServer(t)
defer func() {
if err := ts.Cleanup(); err != nil {
err := ts.Cleanup()
if err != nil {
t.Errorf("cleanup failed: %v", err)
}
}()
@@ -172,7 +175,8 @@ func TestBasicS3Operations(t *testing.T) {
t.Fatalf("failed to get object: %v", err)
}
defer func() {
if err := result.Body.Close(); err != nil {
err := result.Body.Close()
if err != nil {
t.Errorf("failed to close body: %v", err)
}
}()
@@ -192,7 +196,8 @@ func TestBasicS3Operations(t *testing.T) {
func TestBlobOperations(t *testing.T) {
ts := NewTestServer(t)
defer func() {
if err := ts.Cleanup(); err != nil {
err := ts.Cleanup()
if err != nil {
t.Errorf("cleanup failed: %v", err)
}
}()
@@ -255,7 +260,8 @@ func TestBlobOperations(t *testing.T) {
func TestMetadataOperations(t *testing.T) {
ts := NewTestServer(t)
defer func() {
if err := ts.Cleanup(); err != nil {
err := ts.Cleanup()
if err != nil {
t.Errorf("cleanup failed: %v", err)
}
}()