Golang Note | [solved] go get genproto: build constraints exclude all Go files in xxx

Description:

I want to install goproto, so I

What did you do?

go get google.golang.org/protobuf

What did you expect to see?

no error.

What did you see instead?

build constraints exclude all Go files in xxx

Solution:

Protobuf is not a package, So cannot use go get to install.
use this :

go get -u github.com/golang/protobuf/{proto,protoc-gen-go}

or install all packages under protobuf:

go get -u github.com/golang/protobuf/...

你可能感兴趣的:(Golang Note | [solved] go get genproto: build constraints exclude all Go files in xxx)