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

Enable configuration of govet -printfuncs #204

Closed
jsm opened this issue Aug 24, 2018 · 5 comments
Closed

Enable configuration of govet -printfuncs #204

jsm opened this issue Aug 24, 2018 · 5 comments

Comments

@jsm
Copy link

jsm commented Aug 24, 2018

Would it be possible to be able to configure govet printfuncs?

@ncw
Copy link

ncw commented Jan 11, 2019

This would be very useful. I'm having to run go vet -printfuncs Debugf,Infof,Logf,Errorf in addition to golangci-lint - it would be nice to include that too :-)

@jirfag
Copy link
Member

jirfag commented Jan 20, 2019

Thank you! It would be useful feature

@jirfag
Copy link
Member

jirfag commented Mar 17, 2019

I've merged #443 with the newest go vet. It supports:

  1. automatic detection of printing functions
  2. if the function wasn't classified automatically you have two choices:
  • add if false { _ = fmt.Sprintf(format, args...) } as described in go tool vet help printf
  • configure it in .golangci.yml via linters-settings.govet.settings.printf.funcs, see example in .golangci.yml

@jirfag jirfag closed this as completed Mar 17, 2019
@ncw
Copy link

ncw commented Mar 18, 2019

Thank you @jirfag - I've tested that with my codebase and it works perfectly :-)

When are you planning a release? My CI will only use a release build of golangci-lint!

@jirfag
Copy link
Member

jirfag commented Mar 18, 2019

I think in 1-2 days

ncw added a commit to rclone/rclone that referenced this issue Apr 25, 2019
Now that this issue is fixed: golangci/golangci-lint#204

We can use golangci-lint to check the printfuncs too.
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

No branches or pull requests

3 participants