方法1、从github下载然后软连:
git clone https://github.com/golang/sys.git $GOPATH/src/github.com/golang/sysgit clone https://github.com/golang/net.git $GOPATH/src/github.com/golang/netgit clone https://github.com/golang/text.git $GOPATH/src/github.com/golang/textgit clone https://github.com/golang/lint.git $GOPATH/src/github.com/golang/lintgit clone https://github.com/golang/tools.git $GOPATH/src/github.com/golang/toolsgit clone https://github.com/golang/crypto.git $GOPATH/src/github.com/golang/cryptoln -s $GOPATH/src/github.com/golang/ $GOPATH/src/golang.org/xgit clone https://github.com/grpc/grpc-go.git $GOPATH/src/google.golang.org/grpcgit clone https://github.com/golang/net.git $GOPATH/src/golang.org/x/netgit clone https://github.com/golang/text.git $GOPATH/src/golang.org/x/textgo get -u github.com/golang/protobuf/{proto,protoc-gen-go}git clone https://github.com/google/go-genproto.git $GOPATH/src/google.golang.org/genprotocd $GOPATH/src/go install google.golang.org/grpc
方法2、使用go mod修改
go mod edit -replace=golang.org/x/sync@v0.0.0-20180314180146-1d60e4601c6f=github.com/golang/sync@v0.0.0-20180314180146-1d60e4601c6fgo mod edit -replace=golang.org/x/sys@v0.0.0-20180909124046-d0be0721c37e=github.com/golang/sys@v0.0.0-20180909124046-d0be0721c37ego mod edit -replace=golang.org/x/net@v0.0.0-20180906233101-161cd47e91fd=github.com/golang/net@v0.0.0-20180906233101-161cd47e91fdgo mod edit -replace=golang.org/x/text@v0.3.0=github.com/golang/text@v0.3.0go mod edit -replace=golang.org/x/crypto@v0.0.0-20170930174604-9419663f5a44=github.com/golang/crypto@v0.0.0-20170930174604-9419663f5a44go mod edit -replace=google.golang.org/genproto@v0.0.0-20190201180003-4b09977fb922=github.com/google/go-genproto@v0.0.0-20190201180003-4b09977fb922go mod edit -replace=google.golang.org/grpc@v1.18.0=github.com/grpc/grpc-go@1.18.0