一、墙的问题
unrecognized import path "golang.org/x/sys/unix"
解决方法
mkdir $GOPATH/src/golang.org/x/ -p
cd $GOPATH/src/golang.org/x/
git clone https://github.com/golang/sys.git
git clone https://github.com/golang/net.git
git clone https://github.com/golang/tools.git
git clone https://github.com/golang/text.git
二、常用包安装
2.1 geoip、maxmind SDK
go get github.com/oschwald/geoip2-golang
2.2 服务发现——consul
go get github.com/hashicorp/consul
2.3 gRpc安装
2.3.1 windows 下安装:
git clone https://github.com/grpc/grpc-go.git %GOPATH%/src/google.golang.org/grpc
git clone https://github.com/golang/net.git %GOPATH%/src/golang.org/x/net
git clone https://github.com/golang/text.git %GOPATH%/src/golang.org/x/text
go get -u github.com/golang/protobuf/protoc-gen-go
go get -u github.com/golang/protobuf/proto
git clone https://github.com/google/go-genproto.git %GOPATH%/src/google.golang.org/genproto
cd %GOPATH%/src/
go install google.golang.org/grpc
2.3.2 linux 下安装:
git clone https://github.com/grpc/grpc-go.git $GOPATH/src/google.golang.org/grpc
git clone https://github.com/golang/net.git $GOPATH/src/golang.org/x/net
git clone https://github.com/golang/text.git $GOPATH/src/golang.org/x/text
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
git clone https://github.com/google/go-genproto.git $GOPATH/src/google.golang.org/genproto
cd $GOPATH/src/
go install google.golang.org/grpc
2.4 kafka SDK(sarama)
go get -u github.com/Shopify/sarama
2.5 MongoDB SDK
go get -u github.com/jinzhu/gorm
go get -u gopkg.in/mgo.v2/bson