This is a created article in which the information may have evolved or changed.
- Since the extranet is often blocked, the go version of PROTOBUF is downloaded to the local, basically protobuf-master.zip this form.
- The download address for the go version of Protobuf is Https://github.com/golang/protobuf
- After the Protobuf-master.zip is pressurized, renamed to the Protobuf directory, and in the current Go Project src directory, create a new subdirectory github.com, then enter, and then create a new subdirectory Golang
- Then change the directory just renamed to Protobuf, all copied to just Golang folder inside ok!
- Under the Linux platform, enter this Protobuf folder, make is OK, will generate the Protoc executable file in the Gobin file, and generate the relevant. A file in the Pkg folder of the current Go project.
- Under the Windows platform, I am using the Liteide tool, first right click on go install on the Proto folder, and then right click on Go install on the Protoc-gen-go folder. The Protoc-gen-go executable is generated under the Bin folder of the current Go project
- Enter the folder where the custom. Proto file is located, Protoc--go_out=./***.proto in the input command, and the ***.go file is generated under the current folder.