1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-07-17 01:42:37 +02:00

refactor: replace fmt.Errorf with errors.New for consistency (#5294)

The PR replaces usages of `fmt.Errorf` with `errors.New` for creating
errors. Enables `perfsprint` linter to prevent future regressions.
This commit is contained in:
Oleksandr Redko
2024-11-18 19:07:22 +02:00
committed by GitHub
parent bae3bacc7d
commit ae4f6aa662
23 changed files with 57 additions and 37 deletions

View File

@ -1,11 +1,13 @@
package blob
import (
"errors"
"fmt"
"io"
"net/url"
"os"
"path"
"strconv"
"strings"
"github.com/aws/aws-sdk-go/aws"
@ -63,7 +65,7 @@ func urlFor(ctx *context.Context, conf config.Blob) (string, error) {
if conf.S3ForcePathStyle == nil {
query.Add("s3ForcePathStyle", "true")
} else {
query.Add("s3ForcePathStyle", fmt.Sprintf("%t", *conf.S3ForcePathStyle))
query.Add("s3ForcePathStyle", strconv.FormatBool(*conf.S3ForcePathStyle))
}
}
@ -109,7 +111,7 @@ func doUpload(ctx *context.Context, conf config.Blob) error {
up.beforeWrite = func(asFunc func(interface{}) bool) error {
req := &s3manager.UploadInput{}
if !asFunc(&req) {
return fmt.Errorf("could not apply before write")
return errors.New("could not apply before write")
}
req.ACL = aws.String(conf.ACL)
return nil