Home >Backend Development >Golang >How to install golang environment

How to install golang environment

藏色散人
藏色散人forward
2021-04-07 10:00:472388browse

The following tutorial column will introduce to you how to install the golang environment. I hope it will be helpful to friends in need! golang installationDownload golang software

[domestic website] studygolang.com/dl go language Chinese website download the latest installation package of go, according to different systems , you can choose windows, linux, mac

[If you can access the Internet] Visit the go language English website docs.studygolang.com/doc/install
  • Unzip lang
tar -C /usr/local -xzf go1.16.linux-amd64.tar.gz

Configure golang

Add the go binary directory to the PATH environment variable

vim /etc/profileexport GOROOT=/usr/local/goexport PATH=$PATH:$GOROOT/bin
  • Reimport the configuration
source /etc/profile

Golang configuration is correct and download the resources

go env -w GO111MODULE=ongo env -w GOPROXY=https://goproxy.cn,direct

If an error occurs:
warning: go env -w GOPROXY=... does not override conflicting OS environment variable
Modify it directly Here, fill in https://goproxy.cn,direct into the following location

The above is the entire content of this issue. If you have any questions, you can ask them in the comment area or backstage. If you have any questions, we communicate and grow together.

Good guy, if the article is still useful to you, please give it a follow, share it with your circle of friends, share technology, and share happiness

Technology is open, our mentality, It should be more open. Embrace change, live toward the sun, and work hard to move forward.

The above is the detailed content of How to install golang environment. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete