Skip to content

golint is long-deprecated #222

New issue

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

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

Already on GitHub? # to your account

Open
autarch opened this issue Jan 14, 2025 · 1 comment
Open

golint is long-deprecated #222

autarch opened this issue Jan 14, 2025 · 1 comment

Comments

@autarch
Copy link

autarch commented Jan 14, 2025

The style guide recommends using golint, but it is has been deprecated for a long time. I'd also note that golangci-lint marked golint as a deprecated linter in their 1.40.1 release, done in May of 2021. Here's the output from running golangci-lint with the linter included:

level=warning msg="The linter 'golint' is deprecated (since v1.41.0) due to: The repository of the linter has been archived by the owner. Replaced by revive."
level=error msg="[linters_context] golint: This linter is fully inactivated: it will not produce any reports."

I know that in #124 you said you hadn't evaluated revive yet. But at the very least, I think it'd be good to delete the golint references.

@abhinav
Copy link
Collaborator

abhinav commented Jan 15, 2025

Agreed. We should remove 'golint' from the list.

RE: #124 and revive:
IMO the following revive configuration gets us close enough to golint that it might make sense to recommend:

issues:
  include:
    # Require all exported symbols and packages to be documented.
    - [EXC0012, EXC0013, EXC0014, EXC0015]

  exclude-rules:
    # Don't warn on unused parameters.
    # Parameter names are useful information even if unused.
    - linters: [revive]
      text: 'unused-parameter: parameter \S+ seems to be unused, consider removing or renaming it as _'

    # staticcheck already has smarter checks for empty blocks.
    # revive's empty-block linter has false positives like "for foo() {}"
    # as of adding this.
    - linters: [revive]
      text: 'empty-block: this block is empty, you can remove it'

Or we could borrow from Zap's current golangci-lint configuration.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

2 participants