Trying to launch go generate ./... showed me this also
cmd/kod/internal/watcher_test.go:12: running "mockgen": exec: "mockgen": executable file not found in $PATH
So I tried to use
$ task install:mockgen
task: Task "install:mockgen" is up to date
which is wrong as I don't have mockgen installed
- go version -m $GOPATH/bin/mockgen | grep go.uber.org/mock | grep {{.VERSION}}
This code behaves wrongly when mockgen is not installed.
Also, this piece of code relies on GOPATH env variable, that is not always defined (my case). go env GOPATH should be preferred whenever needed.
Also, the installer checks for GOPATH/bin, while code will simply call mockgen directly, without a path so it should check for the presence of mockgen in PATH first
Trying to launch
go generate ./...
showed me this alsoSo I tried to use
which is wrong as I don't have mockgen installed
This code behaves wrongly when mockgen is not installed.
Also, this piece of code relies on GOPATH env variable, that is not always defined (my case).
go env GOPATH
should be preferred whenever needed.Also, the installer checks for GOPATH/bin, while code will simply call mockgen directly, without a path so it should check for the presence of mockgen in PATH first