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

Use golangci-lint instead of golint #68

Merged
merged 3 commits into from
Oct 13, 2022
Merged

Use golangci-lint instead of golint #68

merged 3 commits into from
Oct 13, 2022

Conversation

fasmat
Copy link
Member

@fasmat fasmat commented Oct 12, 2022

golint has been deprecated for a while. In https://github.com/spacemeshos/go-spacemesh we already migrated to golangci-lint instead.

This PR updates post to also use golangci-lint and fixes all complaints that golangci-lint has.

@fasmat fasmat requested a review from a team October 12, 2022 16:19
@fasmat fasmat self-assigned this Oct 12, 2022
@fasmat fasmat mentioned this pull request Oct 12, 2022
.golangci.yml Outdated
linters-settings:
staticcheck:
# Select the Go version to target. The default is '1.13'.
go: "1.18"
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we run on 1.19?

Choose a reason for hiding this comment

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

go-spacemesh is still using 1.18.
the guiding principal (prior to me joining) is that there should be a good reason (feature we want to use) to upgrade go version. but i don't really feel too strongly.

Copy link
Member Author

Choose a reason for hiding this comment

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

post breaks on windows when I try to use 1.18. I will update this config to use 1.19 instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

I created a PR to also update go-spacemesh to use Go 1.19: spacemeshos/go-spacemesh#3650

Copy link
Member

Choose a reason for hiding this comment

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

@countvonzero my point was that in a lot of other places here 1.19 was used ;)

@@ -1,7 +1,7 @@
name: CI

env:
go-version: '1.19'
go-version: "1.19"

Choose a reason for hiding this comment

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

but why is this 1.19?

Copy link
Member Author

@fasmat fasmat Oct 13, 2022

Choose a reason for hiding this comment

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

I tried 1.18. Using it breaks the Windows tests with the following errors:

ThreadSanitizer failed to allocate 0x000000959000 (9801728) bytes at 0x200d8fbb54000 (error code: 87)

See e.g. here: https://github.com/spacemeshos/post/actions/runs/3236096321/jobs/5301430586 with 1.19 this does not happen. I don't know if this is a go 1.18 issue or caused by the GCC that is used by Github. See also golang/go#46099

Copy link
Member

@pigmej pigmej left a comment

Choose a reason for hiding this comment

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

I'm ok with that with the condition that spacemeshos/go-spacemesh#3650 is also ok/merged.

@fasmat fasmat merged commit d4ab158 into develop Oct 13, 2022
@fasmat fasmat deleted the use-golangci-lint branch October 13, 2022 15:27
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.

3 participants