-
Notifications
You must be signed in to change notification settings - Fork 4
Installing Go
Zelenko edited this page Apr 7, 2020
·
16 revisions
- http://devs.cloudimmunity.com/gotchas-and-common-mistakes-in-go-golang/
- https://www.youtube.com/playlist?list=PLSak_q1UXfPrI6D67NF8ajfeJ6f7MH83S Learn To Code - Golang Training
- http://exercism.io/languages/go/about
- https://golang.org/pkg/html/template/
- https://www.youtube.com/watch?v=PZTnp8rDnl0 Web Programming with the Go Programming Language
- https://devhints.io/go Go cheatsheet
Packages are downloaded into folder specified in the $GOPATH system varible:
go get -u gopkg.in/mgo.v2
The 'go get' command requires that the git is installed on Windows.
export GOPATH=/var/go/web/echo $GOPATH
GOOS=linux GOARCH=amd64 go build -o web
set GOARCH=amd64set GOARCH=386set GOOS=linuxset GOOS=windowsecho %GOROOT%
go build -o hello.exe hello.go
List of GOOS/GOARCH supported by Go
cd /usr/local
curl -LO https://redirector.gvt1.com/edgedl/go/go1.9.2.linux-amd64.tar.gz
shasum -a 256 go1.9.2.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz
vi ~/.profile
export PATH=$PATH:/usr/local/go/bin
export GOROOT=/usr/local/go
export GOPATH=/var/go
source ~/.profile
echo $GOROOT
After downloading and installing, specify where the code is stored in system variable. CLI command: set GOPATH=F:\GoCode
Check existing variables go env. Check current version go version.
To download it run:
go get -u github.com/golang/lint/golint
To build it run:
go build github.com/golang/lint/golint
To use it run:
golint ./...
- gocode
- gopkgs
- go-outline
- go-symbols
- guru
- gorename
- dlv
- godef
- goreturns
- golint