Installation FAQ
Installation FAQ
Section titled “Installation FAQ”goctl: command not found after installation
Section titled “goctl: command not found after installation”Ensure $GOPATH/bin is in your PATH:
export PATH=$PATH:$(go env GOPATH)/binecho 'export PATH=$PATH:$(go env GOPATH)/bin' >> ~/.zshrcgo: module ... not found during go mod tidy
Section titled “go: module ... not found during go mod tidy”Make sure you’re using Go 1.18+ and have a valid go.mod:
go version # must be >= 1.18go env GOPROXY # should include https://goproxy.cn or https://proxy.golang.orgSet a proxy if behind a corporate firewall:
go env -w GOPROXY=https://goproxy.cn,directprotoc-gen-go: program not found when running goctl rpc
Section titled “protoc-gen-go: program not found when running goctl rpc”Install the required protoc plugins:
go install google.golang.org/protobuf/cmd/protoc-gen-go@latestgo install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latestOr use goctl’s built-in installer:
goctl env check --installGenerated code has import errors
Section titled “Generated code has import errors”Run go mod tidy inside the generated directory. Also check that go_package in your .proto matches the actual generated directory path.
IDE shows errors in generated files
Section titled “IDE shows errors in generated files”Ensure your IDE’s Go module root is set correctly. For VS Code, open the workspace at the project root containing go.mod.