Closed atc0005 closed 1 year ago
I solved it by excluding the
vendor
path (as I intended) by using this workaround:# https://stackoverflow.com/a/42510278/903870 # https://github.com/golang/go/issues/33962#issue-487227277 diff -u <(echo -n) <(gofmt -l $(find . -type f -name '*.go'| grep -v "/vendor/"))
That worked well enough until I tried to port the line to the project Makefile and hit a wall. I'm sure the syntax is available to do what is desired, but I haven't gotten anywhere with it thus far.
I was told that golangci-lint
has gofmt
linting support, and after taking a closer look evidently you just need to explicitly enable it (it's disabled by default). At this point I think I'm better off going that route instead of trying to figure out the required syntax.
In short, do away with installing/using gofmt
separately and just enable the gofmt
linter for golangci-lint
.
In short, do away with installing/using
gofmt
separately and just enable thegofmt
linter forgolangci-lint
.
The same for golint
at this point. See https://github.com/atc0005/check-mail/issues/23#issuecomment-620498297 for additional details.
Long since resolved.
See https://github.com/atc0005/shared-project-resources (and dependent projects) for current workflow efforts.
While working on atc0005/check-mail#24 I encountered a vendored package that failed
gofmt
checks. I solved it by excluding thevendor
path (as I intended) by using this workaround:I'll need to either update the
gofmt
linting call in all other projects using vendored dependencies to reflect this approach or confirm thatgolangci-lint
already handles thegofmt
functionality and that the linter is enabled.