How to install golang under linux

How to install golang under linux

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. It is simple, fast, safe, parallel, interesting, open source, memory managed, v-array safe, and quick to compile.

Go is designed as a systems programming language for giant central servers such as web servers, storage clusters, or similar purposes. When it comes to high-performance distributed systems, Go undoubtedly has higher development efficiency than most other languages. It provides massive parallel support, which is perfect for game server development. This article introduces how to install golang under Linux. The specific contents are as follows:

1. Download the golang source code installation package

wget https://dl.google.com/go/go1.12.1.linux-amd64.tar.gz

2. Unzip the file

tar -zxvf go1.12.1.linux-amd64.tar.gz -C /usr/local/bin/

3. Configure environment variables

echo "export GOROOT=/usr/local/bin/go/" >> ~/.bashrc
echo "export PATH=$GOROOT/bin:$PATH" >> ~/.bashrc
echo "export GOPATH=$HOME/work/go" >> ~/.bashrc
echo "export PATH=$PATH:$GOPATH/bin" >> ~/.bashrc
source ~/.bashrc

Test whether the installation is successful

[root@iZ2ze40depfadmv9xdxdsxZ src]# go version
go version go1.12.1 linux/amd64

Summarize

The above is the method of installing golang under Linux introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • Notes on installing Golang development environment in Fedora14 Linux system
  • Get access/creation/modification time of files on linux using golang
  • How to call Linux commands using Golang

<<:  js to realize automatic lock screen function

>>:  Solution to the problem of crash when opening the command line window after installing MySQL 5.7

Recommend

Detailed explanation of the use of redux in native WeChat applet development

premise In complex scenarios, a lot of data needs...

Linux installation MySQL tutorial (binary distribution)

This tutorial shares the detailed steps of instal...

How to use Docker to build a tomcat cluster using nginx (with pictures and text)

First, create a tomcat folder. To facilitate the ...

Fixed a bug caused by scrollbar occupying space

background This bug was caused by滾動條占據空間. I check...

How CSS affects the white screen time during initial loading

Rendering pipeline with external css files In the...

A few things about favicon.ico (it’s best to put it in the root directory)

Open any web page: for example, http://www.baidu....

Javascript design pattern prototype mode details

Table of contents 1. Prototype mode Example 1 Exa...

MySQL 8.0.20 compressed version installation tutorial with pictures and text

1. MySQL download address; http://ftp.ntu.edu.tw/...

About ROS2 installation and docker environment usage

Table of contents Why use Docker? Docker installa...

How to implement checkbox & radio alignment

Not only do different browsers behave differently...