mirror of
https://github.com/goreleaser/goreleaser.git
synced 2024-12-31 01:53:50 +02:00
refactor(http): remove redundant nil
check (#4563)
From the Go specification [^1]: > "3. If the map is nil, the number of iterations is 0." Therefore, it is not required to do a nil check for the map before the loop. [^1]: https://go.dev/ref/spec#For_range Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
This commit is contained in:
parent
6097ea50f5
commit
1d44832f6b
@ -238,8 +238,7 @@ func uploadAsset(ctx *context.Context, upload *config.Upload, artifact *artifact
|
|||||||
}
|
}
|
||||||
log.Debugf("generated target url: %s", targetURL)
|
log.Debugf("generated target url: %s", targetURL)
|
||||||
|
|
||||||
headers := map[string]string{}
|
headers := make(map[string]string, len(upload.CustomHeaders))
|
||||||
if upload.CustomHeaders != nil {
|
|
||||||
for name, value := range upload.CustomHeaders {
|
for name, value := range upload.CustomHeaders {
|
||||||
resolvedValue, err := tmpl.New(ctx).WithArtifact(artifact).Apply(value)
|
resolvedValue, err := tmpl.New(ctx).WithArtifact(artifact).Apply(value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -247,7 +246,6 @@ func uploadAsset(ctx *context.Context, upload *config.Upload, artifact *artifact
|
|||||||
}
|
}
|
||||||
headers[name] = resolvedValue
|
headers[name] = resolvedValue
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if upload.ChecksumHeader != "" {
|
if upload.ChecksumHeader != "" {
|
||||||
sum, err := artifact.Checksum("sha256")
|
sum, err := artifact.Checksum("sha256")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user