This is a creation in Article, where the information may have evolved or changed.
Installation section
1. Install the Go package under Windows, download the address Http://www.golangtc.com/download
2. Set the GOPATH environment variable, the PROTOBUF obtained from GitHub will be downloaded to the Gopath directory
3. Install the GIT package, https://git-scm.com/downloads/
4. Add the path of the GIT.exe in the path variable D:\Program files\git\bin (choose the path you installed yourself)
5. Run the git and go commands separately in CMD to see if you can identify the two commands, and if not, you should have missed a step in 1-4.
6. Run separately
Go get-u Github.com/golang/protobuf/proto
go get-u github.com/golang/protobuf/protoc-gen-go
Installing the PROTOBUF Library
7. Download Protoc.exe,proto tools to generate. Go Files https://github.com/google/protobuf/releases
8. Run the command d:\protofile\bin\protoc.exe--plugin=protoc-gen-go=%gopath%\bin\protoc-gen-go.exe--go_out=././gate.proto To generate a Gate.pb.go source file
D:\protofile\bin\protoc.exe is the path where Protoc.exe is located.
--plugin=protoc-gen-go=%gopath%\bin\protoc-gen-go.exe indicates the path where the Protoc-gen-go.exe is located, and if there is no line, you will be prompted to Protoc-gen-go
--go_out=././gate.proto says according to./gate.proto in./Location Go type file