How do we make go vet
, gofmt
, and other Go linter tools ignore third-party files in vendor/
, preferably with an accurate, cumulative exit status?
For example, would find . -name vendor -prune -o -name '*.go' -exec gofmt -s -w {} \;
present a meaningful exit status?
Here is what I use:
golint $(ls -d1 */ | sed s/\\//\\/.../g | grep -v -E "^vendor/" | tr "\n" " ")
I usually do
go fmt $(go list ./... | grep -v /vendor/)
go test $(go list ./... | grep -v /vendor/)
But since I started using govendor
discovered I can do the same using govendor with less typing
govendor fmt +l // +l is shorthand for local
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With