Erecting protobuf in the GO environment

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.
  1. Since the extranet is often blocked, the go version of PROTOBUF is downloaded to the local, basically protobuf-master.zip this form.
  2. The download address for the go version of Protobuf is Https://github.com/golang/protobuf
  3. 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
  4. Then change the directory just renamed to Protobuf, all copied to just Golang folder inside ok!
  5. 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.
  6. 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
  7. 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.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.