Set Go Environment Variables

Source: Internet
Author: User

Linux configuration method: Four environment variables need to be set: goroot, gopath, Gobin, and path. You need to set them to a profile file (~ /. Bash_profile (Single User) or/etc/Profile (all users) goroot: The environment variable value should be the current installation directory of the Go language, for example:ExportGoroot =/usr/local/Gogopath: The environment variable value should be a set of work zones in the go language, for example:ExportGopath = ~ /Golib :~ /Goproject (~Is in the middle) Gobin: its value should be the directory where you want to store the executable files of the Go program, for example:ExportGobin = ~ /Gobinpath: to facilitate the use of the Go language command and the executable file of the Go program, you need to append its value, such:ExportPath = $ path: $ goroot/Bin: $ Gobin append the setup code for these environment variables to a profile file. Make the Code take effect immediately after editing the profile file: Source<Absolute path of a profile File>Verification setting result: Enter go version in any directory under the command line, press enter, and check the print information.
View code

 

Set Go Environment Variables

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.