Home  >  Article  >  Backend Development  >  How to install Go language in Deepin system

How to install Go language in Deepin system

PHPz
PHPzOriginal
2023-04-27 09:09:01964browse

Deepin is a Linux operating system dedicated to providing users with a good desktop experience. As a programming language that has attracted much attention in recent years, the installation process of Go language on the Deepin system is relatively simple. Below, this article will introduce in detail how to install the Go language in the Deepin system.

1. Installation preparations

Before starting the installation, you need to prepare the following links:

  1. Make sure that the Deepin system is the latest version.

Enter the following command in the terminal to check whether the current system is the latest version:

$ sudo apt update && sudo apt upgrade

  1. Install the necessary software package.

Enter the following command in the terminal to install the necessary software packages:

$ sudo apt install build-essential

  1. Download and unzip the Go language installation package .

Go to the official website (golang.org) to download the corresponding version of the Go language installation package, and unzip the downloaded package to the specified directory.

2. Configure environment variables

After installing the Go language, we also need to configure environment variables to access Go in the terminal.

  1. Modify the ~/.bashrc file.

$ sudo vim ~/.bashrc

Add the following configuration at the end of the file:

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

  1. Enable the ~/.bashrc configuration file to take effect.

$ source ~/.bashrc

3. Check whether the installation is successful

Enter the following command in the terminal:

$ go version

If the running result is as follows, it means that the Go language has been successfully installed:

go version go1.12.1 linux/amd64

4. Install the go tool

Install : go tool

go tool is the official command line tool of Go language. It provides some useful tool instructions to enhance interaction with Go language. Enter the following command in the terminal to install:

$ sudo apt install golang-go.tools

5. Install go full documentation

Install: Go Full Documentation

Installing the official and complete go documentation is very simple. Just enter the following command in the terminal:

$ sudo apt install golang-go.doc

After installing the official complete go document, you can open the local document through the browser, for example:

$ firefox /usr/share/doc/golang-go.doc/html/index.html

Through the above steps, we have successfully installed the Go language in the Deepin system and can start us happily A journey into Go programming.

The above is the detailed content of How to install Go language in Deepin system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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