Mac down GO environment variable configuration

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

1.0 See if Bash_profile exists

CD ~/.bash_profile

2.0 Create a Bash_profile Mac environment profile If it does not exist

Touch ~/.bash_profile

3.0 Opening Bash_profile

Open-t ~/.bash_profile

4.0 add GO environment variable: (after the equals sign for your project storage directory)

Gopath=website/apple/apps

5.0 Warning: If the go language cannot be installed due to the creation of the Bash_profile mission to invalidate the line LS command, follow

5.1 Open Bash_profile and add environment variables as above

Export path= "/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/x11/bin"

  5.2 Restart Command line tool remove Bash_profile Close command line remove go file reinstall under (/usr/local/)

RM ~/.bash_profile

5.3 Install the article configuration method reconfiguration can

6 You need to add three folders after configuring a project directory

  The $GOPATH directory convention has three subdirectories:

    • SRC store source code (e.g.,. Go. C. h, etc.)
    • The files generated by the PKG after compilation (for example:. a)
    • Bin compiled executable file (for convenience, this directory can be added to the $PATH variable, if there are multiple gopath, then use to ${GOPATH//://bin:}/bin Add all bin directory)

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.