Appearance
快速开始
Go编译器安装
安装Go多版本管理器(推荐)
- Linux/macOS下自动安装Go多版本管理器(适用于 bash、zsh)
shell$ curl -sSL https://raw.githubusercontent.com/voidint/g/master/install.sh | bash $ cat << 'EOF' >> ~/.bashrc # 可选。检查g别名是否被占用 if [[ -n $(alias g 2>/dev/null) ]]; then unalias g fi EOF $ source "$HOME/.g/env"
- Windows下自动安装Go多版本管理器(适用于 pwsh)
shell$ iwr https://raw.githubusercontent.com/voidint/g/master/install.ps1 -useb | iex
安装Go编译器
shell$ g install 1.22.9
工具链安装
安装protobuf编译器(使用场景:开发mesh微服务、使用protobuf作为与客户端通信的协议)
- Linux, using apt or apt-get, for example:
shell$ apt install -y protobuf-compiler $ protoc --version # Ensure compiler version is 3+
- MacOS, using Homebrew:
shell$ brew install protobuf $ protoc --version # Ensure compiler version is 3+
- Windows, download from Github:
安装protobuf go代码生成工具(使用场景:开发mesh微服务、使用protobuf作为与客户端通信的协议)
shellgo install google.golang.org/protobuf/cmd/protoc-gen-go@latest
安装grpc代码生成工具(使用场景:使用GRPC组件开发mesh微服务)
shellgo install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
安装rpcx代码生成工具(使用场景:使用RPCX组件开发mesh微服务)
shellgo install github.com/rpcxio/protoc-gen-rpcx@latest
安装gorm dao代码生成工具(使用场景:使用GORM作为数据库orm)
shellgo install github.com/dobyte/gorm-dao-generator@latest
安装mongo dao代码生成工具(使用场景:使用MongoDB作为数据库orm)
shellgo install github.com/dobyte/mongo-dao-generator@latest