go modules 包管理使用 1.11开始有go modules管理方案, 1.12 之后的 go module 方式管理代码路径,而不是 gopath 模式。
gRPC
protoc
protocol buffer的安装 https://github.com/protocolbuffers/protobuf/releases
protoc-gen-go
git clone https://github.com/golang/protobuf.git
cd protobuf
git checkout v1.3.2
cd protoc-gen-go
go install
protoc-gen-micro
git clone https://github.com/microhq/protoc-gen-micro.git
cd protoc-gen-micro
git checkout v0.8.0
go install
micro go-micro
go get github.com/micro/micro/v2
#micro v2需要配置groc v1.26.0版本
go get google.golang.org/grpc@v1.26.0
bazel
- mac https://github.com/bazelbuild/bazel/releases/download/1.1.0/bazel-1.1.0-installer-darwin-x86_64.sh
- linux https://github.com/bazelbuild/bazel/releases/download/1.1.0/bazel-1.1.0-installer-linux-x86_64.sh
- windows https://github.com/bazelbuild/bazel/releases/download/1.1.0/bazel-1.1.0-windows-x86_64.exe
install:
$ chmod +x bazel-<version>-installer-linux-x86_64.sh
$ ./bazel-<version>-installer-linux-x86_64.sh --user The --user flag installs Bazel to the $HOME/bin directory on your system and sets the .bazelrc path to $HOME/.bazelrc. Use the --help command to see additional installation options.
set environment: export PATH="$PATH:$HOME/bin"
set goproxy: export GOPROXY=https://goproxy.cn
ORM框架
grom GORM 指南 | GORM - The fantastic ORM library for Golang, aims to be developer friendly.
Go gin:
go redis:
freecache:
GitHub - coocood/freecache: A cache library for Go with zero GC overhead.
服务发现
etcd
常用的环境变量配置
- go env -w GO111MODULE=on
- go env -w GOPROXY=https://goproxy.cn,direct
IDE:
goland
gRPC 工具:
bloomrpc https://github.com/bloomrpc/bloomrpc