One of our primary languages is the Go (AKA Golang) programming language. In Otrego we will largely use the term "Golang" as opposed to "Go", to avoid ambiguity with the game.
- Download from the Golang Website
- If you are on OSX, you can also install with homebrew
Golang has fantastic getting started materials:
- Getting Started with Go
- The Go Tour
- How to Write Go Code
- Go Docs Collection on golang.org
- Go By Example -- Learning Golang by examples.
- The Go Programming Language (Book) -- The best book on the Go programming language.
We use golint for linting our go-files.
go get -u golang.org/x/lint/golint
Make sure the repository builds, assuming you're in clamshell
repository or
some othe other repository that uses Golang:
Build the sources:
# Build current package (current directory)
go build
# Build all packages recursively
go build ./...
Build & test the sources:
# Build and test current package (current directory)
go test ./...
# Test all packages recursively
go test ./...
Make sure your code is formatted:
# Format current package.
go fmt
Ensure go code quality by using go vet and golint.
golint ./...
go vet ./...
- Effective Go: https://golang.org/doc/effective_go -- Style guide & Best practices for Go.
- Code Review Comments: https://github.com/golang/go/wiki/CodeReviewComments -- Common style recommendations that come up in code review.