Skip to content

Commit c35bfac

Browse files
authored
Update models/repo/release.go
1 parent 0f135a3 commit c35bfac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

models/repo/release.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,20 +395,20 @@ func GetReleaseAttachments(ctx context.Context, rels ...*Release) (err error) {
395395
}
396396

397397
// Check if there are two or more attachments with the same name
398-
isDoubled := false
398+
hasDuplicates := false
399399
foundNames := make(map[string]bool)
400400
for _, attachment := range release.Attachments {
401401
_, found := foundNames[attachment.Name]
402402
if found {
403-
isDoubled = true
403+
hasDuplicates = true
404404
break
405405
} else {
406406
foundNames[attachment.Name] = true
407407
}
408408
}
409409

410410
// If the names unique, use the URL with the Name instead of the UUID
411-
if !isDoubled {
411+
if !hasDuplicates {
412412
for _, attachment := range release.Attachments {
413413
attachment.CustomDownloadURL = release.Repo.HTMLURL() + "/releases/download/" + url.PathEscape(release.TagName) + "/" + url.PathEscape(attachment.Name)
414414
}

0 commit comments

Comments
 (0)