Protobuffer installation of Go

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

In the Windows environment:

1. First, you must first have go, the default is installed in the C:\Go

2. Then download protoc,https://code.google.com/p/protobuf/downloads/list, the next binary file, for convenience, can be placed directly into the C:\GO\bin inside

3. Configure Gopath, this is your go project place, should be configured early, such as D:\project\xxx

4.cmd run Go get-u code.google.com/p/goprotobuf/{proto,protoc-gen-go}, looks like win below the pit, will error, so you can separate input go get-u Code.google.com/p/goprotobuf/proto and Go get-u code.google.com/p/goprotobuf/protoc-gen-go

5. Copy the Protoc-gen-go.exe of the bin in the Gopath directory into the C:\GO\bin .

6. Then you can run Protoc, the command is Protoc--go_out=. *.proto

In the Linux environment:

1. Just like win, the default path is/usr/local/go

2. Download https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.bz2, unzip directly,./configure,make,make Install

3. Like win, configuration Gopath can be changed directly in ~/.BASHRC

4. Run the go get-u code.google.com/p/goprotobuf/{proto,protoc-gen-go} directly

5. Similar to win

6. As with win

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.