shell terminal
$ sudo apt-get install golang-go
$ cp .profile .profile_backup
$ sudo nano ~/.profile
.profile
export GOPATH=$HOME/work export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
shell terminal
$ source ~/.profile
$ mkdir $HOME/work
$ mkdir -p work/src/github.com/jimmy2046/hello
$ nano ~/work/src/github.com/jimmy2046/hello/hello.go
hello.go
package main
import "fmt"
func main() {
fmt.Printf("hello, world\n")
}
shell terminal
$ go install github.com/jimmy2046/hello
$ hello
$ which hello
References:
Ubuntu · golang/go Wiki · GitHub
https://github.com/golang/go/wiki/Ubuntu
How to Install Go 1.6 on Ubuntu 16.04
https://www.digitalocean.com/community/tutorials/how-to-install-go-1-6-on-ubuntu-16-04
GoLang Google Sheets API
https://developers.google.com/sheets/api/quickstart/go
No comments:
Post a Comment