On 5/21/2024 12:48 PM, andrew.p...@gmail.com wrote:
Please simplify both of these, so that the user can simply run:

go vet -vettool=shadow

Or:

shadow ./...
> In other words, the user should be able to invoke gofmt on a large Go
> project with:
>
> gofmt ./...
>
> Same request for goimports.
>

The "./..." syntax matches packages, not files and that's why tools which work on files doesn't accept this syntax. The "go" program already has "fmt" sub-command that do exactly this, run gofmt recursively on all matched packages sources, so try "go fmt ./...". Analyzers already accept packages and not files, so "shadow ./..." should work.

I think taking files instead of packages is somewhat legacy, but I found it's useful, since we moved from GOPATH to go modules resolving packages is somehow slow, I definitely feel a delay when using programs that takes packages as an argument, that's very noticeable when you're in a slow filesystem or storage device, so gofmt not taking 5 seconds (unlike go fmt) to run is a good feature.

-w


--
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/f9cea397-3888-457a-a945-589f611c1ed7%40104d.net.

Reply via email to