mac go配置,环境配置

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

  

原文地址:https://www.cnblogs.com/liubiaos/p/13576186.html