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

Vue implements simple comment function

This article shares the specific code of Vue to i...

Use of JavaScript sleep function

Table of contents 1.sleep function 2. setTimeout ...

Mysql master/slave database synchronization configuration and common errors

As the number of visits increases, for some time-...

How to implement call, apply and bind in native js

1. Implement call step: Set the function as a pro...

Detailed explanation of Nginx Rewrite usage scenarios and code examples

Nginx Rewrite usage scenarios 1. URL address jump...

Method of realizing automated deployment based on Docker+Jenkins

Use Code Cloud to build a Git code storage wareho...

About Vue's 4 auxiliary functions of Vuex

Table of contents 1. Auxiliary functions 2. Examp...

Detailed tutorial on installing Ubuntu 19.10 on Raspberry Pi 4

Because some dependencies of opencv could not be ...

Detailed analysis of the principles and usage of MySQL views

Preface: In MySQL, views are probably one of the ...

React passes parameters in several ways

Table of contents Passing parameters between pare...

Sample code for highlighting search keywords in WeChat mini program

1. Introduction When you encounter a requirement ...

Introduction to local components in Vue

In Vue, we can define (register) local components...