Skip to content

Latest commit

 

History

History
83 lines (57 loc) · 1.91 KB

golang.md

File metadata and controls

83 lines (57 loc) · 1.91 KB

The Go Programming Language

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.

Installing

Learning Golang

Golang has fantastic getting started materials:

  1. Getting Started with Go
  2. The Go Tour
  3. How to Write Go Code
  4. Go Docs Collection on golang.org
  5. Go By Example -- Learning Golang by examples.
  6. The Go Programming Language (Book) -- The best book on the Go programming language.

Installing Tools

We use golint for linting our go-files.

go get -u golang.org/x/lint/golint

Workflows

Building and Testing

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 ./...

Ensuring Code Qualiy

Make sure your code is formatted:

# Format current package.
go fmt

Ensure go code quality by using go vet and golint.

golint ./...
go vet ./...

Other Resources