Install Go compiler on ubuntu20.04

wget https://golang.google.cn/dl/go1.18.linux-amd64.tar.gz

Get the Go compiler installation files.

sudo tar -C /usr/local -zxvf go1.18.linux-amd64.tar.gz

Unzip the file to the /usr/local path.

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

Add the Go compiler executable to system variables.

go version

Check the compiler version.

package main

import "fmt"

func main() {
   fmt.Println("Hi, GO!")
}

Create a new go file.

go run hello.go

Run to see if the compiler works.

Guess you like

Origin blog.csdn.net/k1nh00/article/details/123766158