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 MySQL select cache mechanism

MySQL Query Cache is on by default. To some exten...

How to install git on linux

1. Introduction Git is a free, open source distri...

mysql startup failure problem and scenario analysis

1. One-stop solution 1. Problem analysis and loca...

How to implement web stress testing through Apache Bench

1. Introduction to Apache Bench ApacheBench is a ...

MySQL Daemon failed to start error solution

MySQL Daemon failed to start error solution A few...

Implementation of Docker cross-host network (manual)

1. Introduction to Macvlan Before the emergence o...

Detailed tutorial on distributed operation of jmeter in docker environment

1. Build the basic image of jmeter The Dockerfile...

Use native js to simulate the scrolling effect of live bullet screen

Table of contents 1. Basic principles 2. Specific...

Introduction to the properties of B-Tree

B-tree is a common data structure. Along with him...

Display mode of elements in CSS

In CSS, element tags are divided into two categor...

How to preview pdf file using pdfjs in vue

Table of contents Preface think Library directory...