[!TIP] This document is machine-translated by Google. If you find grammatical and semantic errors, and the document description is not clear, please PR
Goctl plays a very important role in the development of the go-zero project. It can effectively help developers greatly improve development efficiency, reduce code error rate, and shorten the workload of business development. For more introductions to Goctl, please read Goctl Introduction ,
Here we strongly recommend that you install it, because most of the follow-up demonstration examples will use goctl for demonstration.
# Go 1.15 及之前版本 GO111MODULE=on go get -u github.com/tal-tech/go-zero/tools/goctl@cli # Go 1.16 及以后版本 go install github.com/tal-tech/go-zero/tools/goctl@cli
Environmental variable detection
The compiled binary file downloaded by
go getis located in the
$GOPATH/bindirectory. Make sure that
$GOPATH/binhas been added to the environment variable.
$ sudo vim /etc/paths
Add the following in the last line
$GOPATHis the filepath on your local machine
Installation result verification
$ goctl -v
goctl version 1.1.4 darwin/amd64
[!TIP] For windows users to add environment variables, please Google by yourself.