Open SmileJayden opened 3 years ago
You probably need to write export PATH="$PATH:$(go env GOPATH)/bin"
in a shell script that is always executed. Traditionally ~/.profile
or ~/.bashrc
(or ~/.zprofile
, ~/.zshrc
if you use zsh).
If you've added github.com/cheekybits/genny
to your go.mod file, you can also try using something like:
//go:generate go run github.com/cheekybits/genny -in=$GOFILE -out=gen-$GOFILE gen "KeyType=string,int ValueType=string,int"
try this one:
go install github.com/cheekybits/genny
//go:generate genny -in=$GOFILE -out=gen-$GOFILE gen "KeyType=string,int ValueType=string,int"
go generate ./...
command with above comment reproducerunning "genny": exec: "genny": executable file not found in $PATH
messege for me.However, if I do that command with
//go:generate $GOPATH/bin/genny -in=$GOFILE -out=gen-$GOFILE gen "KeyType=string,int ValueType=string,int"
this comment, genny generation works for me well.I want to use
//go:generate genny -in=$GOFILE -out=gen-$GOFILE gen "KeyType=string,int ValueType=string,int"
this comment which is document's recommended comment.How can I use this one with the best?
below is my
go env
Thanks!