Install Golang from source (compile)

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

Install Golang from source (compile) two


"From the Source (compilation) installation Golang One"(http://www.cnblogs.com/majianguo/p/7258975.html) recorded from the official download Golang source code, on ubuntu build Golang The process of developing the environment. The compiled tool software lacks godoc, which requires a separate compilation of the installation, the following is mainly about the steps to compile Godoc ( operation on Raspberrypi + Raspbian).

Download the golang/tools source code (Https://github.com/golang/tools) from GitHub and place the source in the $GOPATH/src/golang.org/x/ Tools,

wget https://github.com/golang/tools/archive/master.zipcp Master. zip /home/pi/mygo/src/golang.org/x/unzip master. Zip MV tools-master Tools

Then open the command line, switch to the directory, execute gobuild, and move the compiled Godoc to the $GOROOT/bin


Pi@raspberrypi:~/go-go1. 9.2/bin $ cd/home/pi/mygo/src/golang.org/x/tools/cmd/godoc/pi@raspberrypi:~/mygo/src/ golang.org/x/tools/cmd/Godoc $ go buildpi@raspberrypi:mv godoc/home/pi/go-go1. 9.2 // bin/ Pi@raspberrypi:~/mygo/src/golang.org/x/tools/cmd/godoc $


Verifying the installation, performing godoc-http:8088 on the terminal


Pi@raspberrypi:~/go-go1. 9.2/bin $ godoc-http:8088


Open http://127.0.0.1:8088 in the browser

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.