go vet fails to obey the standard PATH environment variable (POSIX, 
Windows). This makes it unnecessarily cumbersome to use go vet.

Here is an example (Mage) script to scan Go projects for variable shadowing:

func GoVetShadow(args ...string) error {
shadowPath, err := exec.LookPath("shadow")

if err != nil {
return err
}

return GoVet(fmt.Sprintf("-vettool=%s", shadowPath))
}

The shadow tool is unable to recurse over Go projects with the ordinary 
./... syntax; It relies on go vet. And even with the x/tools shadow 
installed and on PATH, go vet nevertheless requires an absolute path to the 
program.

Please simplify both of these, so that the user can simply run:

go vet -vettool=shadow

Or:

shadow ./...

Which are easier to remember and lighter on the fingers.

Some gophers will point out that we already have a working solution with 
Mage, and it's conceivable that equivalents are available in related build 
systems like make (POSIX, GNU, BSD, etc.) or sh (POSIX, bash, zsh, etc.) 
However, the requirement for the user to provide an absolute path tends to 
create maintenance hassles, fragile build scripts, many portability 
problems, and general resource waste. PATH already provides the 
information; please stop breaking basic things at the process level.

-- 
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/d7c16676-9cc3-477e-a822-af5deba12e12n%40googlegroups.com.

Reply via email to