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

How to install golang environment

藏色散人
Release: 2021-04-07 10:00:47
forward
2390 people have browsed it

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
Copy after login

Configure golang

Add the go binary directory to the PATH environment variable

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

Golang configuration is correct and download the resources

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

If an error occurs:
warning: go env -w GOPROXY=... does not override conflicting OS environment variable
Copy after login
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!

Related labels:
source:learnku.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template