This is a created article in which the information may have evolved or changed.
Goroot:go installation path, the official package path is automatically matched according to this setting
Gopath: Working path (in fact, should not be interpreted in Chinese translation, directly said Gopath more appropriate)
To install PROTOBUF, you need to set the Gopath path.
1, export gopath= ...//This is to set the Gopath path to memory, reboot will expire
2, Vi/etc/profile, in the end add the export gopath= ..., and then restart, so that the equivalent of each boot will be loaded Gopath
Create three folders bin, pkg, and SRC under the Gopath path, copy the installation package to src/github.com/golang/protobuf/so that there will be some installation files and proto in the Protobuf directory, Protoc-gen-go and JSONPB three folders. Go to protobuf directory to execute make