mdempsky/unconvert

Make ... syntax work for packages

cespare opened this issue ยท 7 comments

Thanks for the great tool! It would be nice if you could do e.g. unconvert ./... to check a tree of packages at once.

Is ... expansion something commonly supported by other similar tools? I know x/tools/cmd/eg doesn't.

I've been using

unconvert `go list ./...`

errcheck supports it (by using github.com/kisielk/gotool, which is extracted from the Go tool), golint supports it (haven't checked how), guru now supports it (by using its own implementation in buildutil which allows negations, but doesn't understand "std" or "all")

Okay, sounds like unconvert should support it too then.

gostatus supports it (by using github.com/kisielk/gotool), goimporters supports it (by using github.com/kisielk/gotool and resolveRelative), and goimportgraph supports it (by using github.com/kisielk/gotool and resolveRelative). They're all tools I made.

I think it's great for Go tools to support import path patterns, I consider them an excellent feature of Go. If a tool says it accepts [packages] but doesn't allow import path patterns, it's unfortunate.

Also, github.com/kisielk/gotool makes it very easy to do so, so there's no reason not to.

I was originally hesitant to add non-stdlib dependencies, but I see now that github.com/kisielk/gotool is pretty trivial and self-contained. If someone wants to upload a PR to make use of it, I'll review it. (Same offer goes for mdempsky/maligned#4.)

Yep, it's basically original stdlib code but made exported, so it can be reused by 3rd party tools.

I'll make that PR tonight if no one beats me to it.

Made #9.