Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Fix golangci linter failure #1156

Merged
merged 8 commits into from
May 9, 2024
Merged

CI: Fix golangci linter failure #1156

merged 8 commits into from
May 9, 2024

Conversation

danaelhe
Copy link
Member

@danaelhe danaelhe commented May 9, 2024

In recent PRs such as #1155 , we were getting Error: golangci-lint exit with code 7 with the Lint with golangci-lint step in the CI. I was able to reproduce the issue locally:

de@ terraform-provider-digitalocean % make lint
.....
INFO File cache stats: 0 entries of total size 0B 
INFO Memory: 11 samples, avg is 40.3MB, max is 64.2MB 
INFO Execution took 975.842607ms                  
make: *** [lint] Error 7

Turns out it's a mix match of go version 1.21 and the version of golangci being used. Need to update go version to 1.22.x in the pipeline and stick golangci to versionv1.56.2in the makefile. This allowed a successful run locally:

de@ terraform-provider-digitalocean % golangci-lint run -v ./...
....
INFO [runner] linters took 5.944091265s with stages: goanalysis_metalinter: 5.938364426s 
INFO File cache stats: 0 entries of total size 0B 
INFO Memory: 69 samples, avg is 465.9MB, max is 888.3MB 
INFO Execution took 6.772305539

@danaelhe danaelhe requested a review from a team May 9, 2024 16:28
Copy link
Member

@andrewsomething andrewsomething left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 lgtm!!

@danaelhe danaelhe merged commit 8ea164e into main May 9, 2024
3 checks passed
@danaelhe danaelhe deleted the fix_ci branch May 9, 2024 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants