Skip to content

Conversation

alexandear
Copy link
Contributor

@alexandear alexandear commented Jun 24, 2025

revive.modifies-value-receiver reports that artifact.Checksum doesn't set the artifact.Extra field due to the use of a value receiver in:

func (a Artifact) Checksum(algorithm string) (string, error)

Golangci-lint output:

$ golangci-lint run
internal/artifact/artifact.go:359:3: modifies-value-receiver: suspicious assignment to a by-value method receiver (revive)
                a.Extra = make(Extras)
                ^
1 issues:
* revive: 1

I believe this is a bug. If it’s not, we can remove the following lines (added in #4707), since they have no effect on the original Artifact:

if a.Extra == nil {
	a.Extra = make(Extras)
}
a.Extra[ExtraChecksum] = fmt.Sprintf("%s:%s", algorithm, check)

@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 24, 2025
Copy link

codecov bot commented Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.67%. Comparing base (f4869f9) to head (3f3d766).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5849      +/-   ##
==========================================
- Coverage   82.69%   82.67%   -0.02%     
==========================================
  Files         164      164              
  Lines       16460    16460              
==========================================
- Hits        13612    13609       -3     
- Misses       2256     2258       +2     
- Partials      592      593       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexandear alexandear force-pushed the fix/artifact-extra branch from 7fa536f to 3f3d766 Compare June 24, 2025 09:56
@pull-request-size pull-request-size bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 24, 2025
@caarlos0 caarlos0 merged commit d4b3fd6 into goreleaser:main Jun 24, 2025
15 of 16 checks passed
@caarlos0
Copy link
Member

Thank you!

@alexandear alexandear deleted the fix/artifact-extra branch June 25, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants