uber-go / goleak

Goroutine leak detector
MIT License
4.48k stars 148 forks source link

lint: replace deprecated golang.org/x/lint/golint with golangci-lint #95

Closed pohly closed 1 year ago

pohly commented 1 year ago

golint is deprecated. golangci-lint is a more than adequate replacement. Because it combines different linters, a single invocation in the Makefile is enough and then produces consistent output for all of them.

It also gets enabled as a GitHub action. This will annotate pull requests.

The godox linter gets enabled as replacement for the manual "grep -i fixme".

For the sake of convenience, "make lint" installs golangci-lint. In contrast to golint before, this is done without polluting the go.mod file with the extra dependencies.

Fixes: #92

codecov[bot] commented 1 year ago

Codecov Report

Merging #95 (a7c49f9) into master (70e025e) will not change coverage. The diff coverage is n/a.

:exclamation: Current head a7c49f9 differs from pull request most recent head 2b5723b. Consider uploading reports for the commit 2b5723b to get more accurate results

@@           Coverage Diff           @@
##           master      #95   +/-   ##
=======================================
  Coverage   94.92%   94.92%           
=======================================
  Files           5        5           
  Lines         138      138           
=======================================
  Hits          131      131           
  Misses          4        4           
  Partials        3        3           

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

pohly commented 1 year ago

@prashantv: do you want me to rebase or shall I close this PR? Entirely up to you, I'm fine with both.

prashantv commented 1 year ago

@pohly Thanks for the PR, since revive is a drop-in replacement that runs faster, I put that up in #97.

I think let's keep both open to see what direction others prefer -- if golangci-lint is preferred, then this PR can be rebased.

abhinav commented 1 year ago

Thanks, @pohly. This can probably be closed now that #97 is merged. (golangci-lint is cool, but it does a lot more than golint. If we ever switch to it, we'll want to drop staticcheck as well since golangci-lint bundles it in too.)

pohly commented 1 year ago

Please don't forget to do a release :smile: