Goctl

    goctl is a code generation tool under the go-zero microservice framework. Using goctl can significantly improve development efficiency and allow developers to focus their time on business development. Its functions include:

    • api service generation
    • model code generation
    • template management

    This section will contain the following:

    If goctl is installed, it will output text information in the following format:

    1. goctl version ${version} ${os}/${arch}

    For example output:

    • version: goctl version number
    • os: Current operating system name
    • arch: Current system architecture name
    1. $ GO111MODULE=on GOPROXY=https://goproxy.cn/,direct go get -u github.com/zeromicro/go-zero/tools/goctl

    Use this command to install the goctl tool into the directory

    The way two (fork and build)

    Pull a source code from the go-zero code repository git@github.com:zeromicro/go-zero.git, enter the tools/goctl directory to compile the goctl file, and then add it to the environment variable.

    1. command not found: goctl

    Please make sure that goctl has been installed, or whether goctl has been correctly added to the environment variables of the current shell.