Lets Learn Go :)
BSD-2-CLAUSE License
(Note: nothing is right here! that's just some notes while i was learning)
Get started from here
The first crazy thing, i'm using cygwin on holy windows(R) . when you are setting $GOPATH it detects absolute unix paths as relative path and export GOPATH=`pwd`
seems not working. so workaround is GOPATH=`cygpath -aw .`
(maybe i will make a helper script for this GOPATH
thing)
So lets compile and test my hello-go
mkdir -p src/github.com/pi0/letsgo
vi src/github.com/pi0/letsgo/hello.go
package main
import "fmt"
func main() {
fmt.Printf("hello, دنیا\n")
}
> go install github.com/pi0/letsgo
[Silent!]
> ./bin/letsgo.exe
hello, world
> du -h ./bin/letsgo.exe
2.4M ./bin/letsgo.exe
go get golang.org/x/tour/gotour
./bin/gotour.exe
Bang! Super nice, browser showed off with a offline version on http://127.0.0.1:3999/welcome/1
Read this pages for more information about Go workspace structure and dependancy managers:
GOPATH
Su**s everywhere!On windows i created a .go
directory inside my home dir and set this environment vars:
GOPATH=C:\Users\pooya\.go
PATH=....;C:\Users\pooya\.go\bin
Also there is a useful command go env
to test current Go environment configs.
Godep helps build packages reproducibly by fixing their dependencies. Godep
To get started: go get github.com/tools/godep
[TODO]
[TODO] Read Here