引用 GOLANG
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
直接載下 binary 檔
wget https://dl.google.com/go/go1.13.7.linux-amd64.tar.gz tar zxf go*.linux-amd64.tar.gz -C /usr/local
設定環境變數 vi ~/.bash_profile
export GOROOT=/usr/local/go export GOPATH=$HOME/go export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
寫個範例 vi hello.go
package main import "fmt" func main() { fmt.Printf("hello, world\n") }
執行方式
go run hello.go
或
go build hello.go ./hello
留言