should goimports ignore directories starting with "."

96 views
Skip to first unread message

Greg Lowe

unread,
Apr 27, 2023, 10:07:09 AM4/27/23
to golang-nuts
The recommend approach caching go modules is to create a ".go" directory in the top level of a project. See: https://docs.gitlab.com/ee/ci/caching/#cache-go-dependencies

go test, go vet, go list and staticcheck ignore this directory because is starts with ".".

We use goimports within our pipeline. I'd like to not include ".go" in the directories scanned, as this leads to pipeline failures and is slow.

What's the best way to handle this at the moment?

And I'm also curious if there's a reason why goimports behaves differently to other go tools.

Reply all
Reply to author
Forward
0 new messages