Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build Go Development Environment on deepin

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to build a Go development environment on deepin". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let Xiaobian take you to learn "how to build a Go development environment on deepin"!

1. Go Installation Package Download

Download Go install package go1.12.9.linux-amd64.tar.gz

Download address: golang.google.cn/dl/

2. Unzip Install Go

You can directly-> right-click on the file-> extract (extract) to the current folder

Or command: tar zxvf go1.12.9.linux-amd64.tar.gz

Next, copy the decompressed files to the system directory. There are 3 common software installation directories. If you want to install golang as soon as possible, you can ignore it.

/usr : System software installation directory

/usr/local : user software installation directory

/opt : Large software installation directory

Install it here in/usr/local, move the go folder generated after decompression to/usr/local/directory:

Terminal command (move): sudo mv go /usr/local

Or command (copy): sudo cp -r go /usr/local

3. Go environment variable configuration

Next comes the final step of environment variable configuration, which is often easy to ignore.

Terminal command: vim ~/.bashrc or vim ~/profile

(bashrc is valid for all users of the system, profile is valid for the current user)

There are three variables GOPATH, PATH, GOROOT: GOROOT is the installation path of go; GOPATH is the working directory of go; PATH is the bin directory of go installation path.

After entering the command, press insert to enter, paste the following contents into it (any blank space can be used, it is recommended to start or end):

export GOROOT="/usr/local/go"

export GOPATH="/go"

export PATH=$PATH:/usr/local/go/bin

After entering, press ESC to exit and enter:wq to save. After saving, there is still a step to make the changed environment variables take effect. Enter the following command in the terminal:

source ~/.bashrc or source ~/profile

At this point, golang installation configuration is complete, can be detected by the following command

go version

After entering go version, you can see the version number, which means that the installation is successful.

At this point, I believe everyone has a deeper understanding of "how to build a Go development environment on deepin." Let's do it in practice! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report