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

fix: check that the variable resp is not nil (#3670)

# If applied, this commit will

Linked issues will be resolved.

# Why is this change being made?

Because the program will no longer have to refer to nil.

# Provide links to any relevant tickets, URLs or other resources
- https://github.com/goreleaser/goreleaser/issues/3669
This commit is contained in:
Ochi Daiki
2022-12-29 21:29:15 +09:00
committed by GitHub
parent 71000969c0
commit 3734c2d9be

View File

@ -325,10 +325,14 @@ func (c *githubClient) Upload(
file, file,
) )
if err != nil { if err != nil {
requestID := ""
if resp != nil {
requestID = resp.Header.Get("X-GitHub-Request-Id")
}
log.WithFields(log.Fields{ log.WithFields(log.Fields{
"name": artifact.Name, "name": artifact.Name,
"release-id": releaseID, "release-id": releaseID,
"request-id": resp.Header.Get("X-GitHub-Request-Id"), "request-id": requestID,
}).Warn("upload failed") }).Warn("upload failed")
} }
if err == nil { if err == nil {