For go fmt
command it is easy to do as:
go fmt $$(go list ./...| grep -v /vendor/)
How can do it with gofmt
which recursive by default?
In gofmt, the default format is: use gofmt .
, how can ignore vendor in this?
Or is there way to use go list
output for gofmt
?
One way is gofmt -l (find . -type f -name '*.go'| grep -v "/vendor/")
, is there an easier way?