Complete guide to installing Go language on Linux system
Go language (also known as Golang) is an open source programming language developed by Google. It is known for its simplicity, It is favored by developers for its efficient and concurrent processing capabilities. If you want to learn and use the Go language on a Linux system, this article will provide you with a complete installation guide from scratch to help you easily set up a Go language development environment.
First, we need to install the binary release version of the Go language on the Linux system. The specific steps are as follows:
wget https://golang.org/dl/go1.17.1.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.17.1.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin export GOPATH=$HOME/go export PATH=$PATH:$GOPATH/bin
source ~/.bashrc
go version
If you see output similar to the following, it means that the Go language is installed successfully:
go version go1.17.1 linux/amd64
Now, the Go language has been successfully installed on your Linux system . Next, let's create a simple Hello World program to make sure everything is working properly.
mkdir ~/hello && cd ~/hello
package main import "fmt" func main() { fmt.Println("Hello, World!") }
go run main.go
If you see the terminal output "Hello, World!", then congratulations, you have successfully installed and run it on the Linux system Go language program!
Summary:
Through the complete installation guide provided in this article, you have learned to install the Go language on the Linux system, configure environment variables, and successfully run a simple Hello World program. Now, you can start exploring more Go language features and learning resources, and start your Go language programming journey!
I hope this article will be helpful to you, and I wish you success in learning and developing Go language!
The above is the detailed content of Starting from Scratch: A Complete Guide to Installing Go Language on Linux Systems. For more information, please follow other related articles on the PHP Chinese website!