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

linter: fixes for staticcheck #27

Merged
merged 1 commit into from Sep 28, 2022
Merged

linter: fixes for staticcheck #27

merged 1 commit into from Sep 28, 2022

Conversation

sknat
Copy link
Contributor

@sknat sknat commented Aug 11, 2022

As golint is now deprecated, this patch proposes to
switch to staticcheck [0] as an alternative, in addition
to go vet.
This patch contains fixes addressing the linter's reported
issues, with two added exceptions :

  • The MemoryStats deprectated fields are still for us to update
  • In gen_encoding.go we need to add an extra comment
    to account for the unused variable. This is probably worth
    addressing in another patch to not generate a variable we don't use.

[0] https://staticcheck.io/

Signed-off-by: Nathan Skrzypczak nathan.skrzypczak@gmail.com
Change-Id: I0562f290fb908bc610c44d675e21e466d0badc27

@ondrej-fabry
Copy link
Member

It seems pointless to add special comments to the generated files. The tool should ignore the generated files entirely.

@sknat sknat changed the title linter: move to staticcheck linter: fixes for staticcheck Aug 11, 2022
binapi/abf/abf.ba.go Outdated Show resolved Hide resolved
@sknat
Copy link
Contributor Author

sknat commented Sep 22, 2022

Removed the changes in the generated code for now & updated the patch

binapi/pp2/pp2.ba.go Outdated Show resolved Hide resolved
As golint is now deprecated, this patch proposes to
switch to staticcheck [0] as an alternative, in addition
to `go vet`.
This patch contains fixes addressing the linter's reported
issues, with two added exceptions :
- The MemoryStats deprectated fields are still for us to update
- In `gen_encoding.go` we need to add an extra comment
to account for the unused variable. This is probably worth
addressing in another patch to not generate a variable we don't use.

[0] https://staticcheck.io/

Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Change-Id: I0562f290fb908bc610c44d675e21e466d0badc27
@ondrej-fabry ondrej-fabry merged commit fd89a9c into master Sep 28, 2022
@ondrej-fabry ondrej-fabry deleted the improve/linter branch September 28, 2022 08:37
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

3 participants