Skip to content

hanksudo/go-101

Repository files navigation

go-101

Learn Go Programming Language https://golang.org

Install Go (on Mac)

brew install go

Folder structures

Basic Commands

# download from remote (download into both ./src and ./bin)
go get github.com/hanksudo/go-101/tour/hello

# run program
go run tour/hello/hello.go
go run tour/functions/functions.go

# build program
cd hello
go build hello.go
./hello

# go install to $GOPATH/pkg
go install newmath

# go install to $GOPATH/bin
go install mathapp

# test code
go test github.com/hanksudo/go-101/tour/stringutil

# format code syntax
go fmt -w

# documentation
godoc builtin
godoc net/http
godoc fmt Printf
godoc -http=:8080

# others
go version
go env
go list
go list all
go list -json all

Rerun Go program when file modified

go get -u github.com/hanksudo/gowatch
gowatch -f main.go

References

Releases

No releases published

Packages

No packages published

Languages