1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-06 03:13:48 +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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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