install go vesion 10 on ubuntu

how to install go newest version?
sudo apt-get install golang
install go 1.6 --- too old

https://www.golangtc.com/download
1.9
https://studygolang.com/dl
1.10
download 1.10 OK -- go1.10.linux-amd64.tar.gz
tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz
tar -C /usr/local -xzf go1.10.linux-amd64.tar.gz

etc/profile add path
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin

$home/.bashrc
export GOPATH=$HOME/go/goeg

$GOPATH/src/hello/hello.go
package main

import "fmt"

func main() {
    fmt.Printf("hello, world\n")
}

$ cd $GOPATH/src/hello
$ go build
$./hello

OK,install complete

猜你喜欢

转载自blog.csdn.net/hb_zxl/article/details/79874426