Go version
dfb2e42
What operating system and processor architecture are you using (go env)?
What did you do?
In a discussion with @matloob about #62114, I remembered the $PATH environment logic that I added to go test and go generate for #51473 (comment).
What did you expect to see?
If the go command is being run from $GOROOT/bin/$GOOS_$GOARCH, as may be the case in multi-arch Go installations, the $PATH setting used for go generate and go test should include that path.
Compare:
What did you see instead?
The $PATH setting includes only $GOROOT/bin:
https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/base/env.go;l=41-45;drc=dfb2e4265bf7654001c77925dfbbb9c38c0d1a95
And the path used for looking up the current go command also checks only $GOROOT/bin:
https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/generate/generate.go;l=490;drc=dfb2e4265bf7654001c77925dfbbb9c38c0d1a95