1、下載go
https://golang.google.cn/dl/
也可以實用brew brew info go 來下載,或者是進入官網下載:https://golang.org/dl/
1.1下載brew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
2、安裝goland
https://www.jetbrains.com/go/download/
3、添加 go get速度慢的問題
go env -w GO111MODULE=on (這個地方參數如果平常用,打包的時候需要使用go mon,如果關閉可以正常打包)go env -w GO111MODULE=off
go env -w GOPROXY=https://goproxy.cn,direct
4、下載proto
brew info protobuf (查看)
brew install protobuf (安裝)
protoc --version (查看版本)
4.1、使用proto編譯時候,需要protoc-gen-go來進行編. (建議參考)https://blog.csdn.net/wangxinxinsj/article/details/90294238
go get github.com/golang/protobuf/protoc-gen-go go get -u -v github.com/golang/protobuf/protoc-gen-go