Install the go language on your Mac

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

I will install the Go Language development environment on Mac OS X's development machine.

Go language Runtime package download address: http://code.google.com/p/go/downloads/list

Here I choose to install go1.0.3.darwin-amd64.pkg

Click Install on Mac, run package automatically install to/usr/local/go, so you can run go command at command Terminal.

Here, I install the Go editor into my Xcode application, because my Xcode is more than 4.x

In/usr/local/go/misc, you can see there are a lot of editor versions, here to find the Xcode directory, inside into 4, there is a go4xcode.sh

In the terminal, enter:

sudo sh
./go4xcode.sh

There may be, you will report the following error:

Xcrun:Error:could not stat active Xcode path '/volumes/xcode/xcode44-dp7.app/contents/developer '. (No such file or directory)

Can view this workaround: Http://stackoverflow.com/questions/11456918/change-xcrun-developer-path

Solved by Xcode-select command.

The default Mac installs the Go run package, does not add the GOROOT environment variable, you must be added a goroot to/usr/local/go the directory, so that when the go4xcode.sh is executed, there will be no error.

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.