Go Learn - MVP course

v0.1.0 by
The first course is aimed at already experienced developers. No knowledge of Go is required, though prior programming is. You will be shown how to reach a minimum viable product(MVP), as it is a progressive journey rather than a preset goal.

Contents

After this course you will be familiar with and most importantly, recognize when you have reached an MVP.

You can download the examples that where produced during the course ex.tgz. Unpack it in $GOPATH/src/go-learn/.

First day

Get to know the language and it's tools.

09.00
09.30
  • go test -v
  • declare variables, short long, single/multi
  • existing types, int, string, byte, rune
  • if else and operators
  • variable scope
  • switch, single/multi and default
  • fallthrough
10.00
  • hello world
  • naming files, x_test.go
  • testing package
  • hello world func
  • t.Log, t.Error, t.Fatal
  • gofmt, readability is key
  • go test -bench
10.20BREAK
10.30
  • slice, make and append
  • len and cap
  • Examples
  • GrowSlice(max int) example
  • ranges str[1:4]
  • for loop, range, _(blank identifier)
  • labels, break and continue
  • goto
11.00
  • own types
  • constants and iota
  • structs, field visibility
  • pointers
  • func, naming arguments, visibility
  • constructors
  • methods
  • errors
11.30
  • go env and GOPATH
  • go get -u github.com/gregoryv/uncover/...
  • go test -coverprofile
12.00LUNCH
13.00 Exercises
  • cat FILE
  • contains WORD FILE, exit code 0|1
  • mygrep WORD FILE
  • json2txt FILE.json, A=1, B=2
15.00END

Second day

Concurrency features and create a tool which you can actually use.

09.00
  • Walkthrough of day 1 exercises
  • Example tests
  • interfaces and interface{}
  • named return errors
  • defer
  • panic
10.00
  • channels
  • range over channel
  • ok, more := <- chan
  • select
  • go statement
  • directions
10.20BREAK
10.30
  • directory structure, package/cmd/X
  • README.md, CHANGELOG.md, CONTRIBUTING.md
  • scripting, go run x.go
  • package main and imports
  • naming packages, go-learn becomes learn
  • package namespace and .
  • compiling, go build x.go
  • standalone, CGO_ENABLED=0
  • flag package and usage
  • ldflags "-X main.version=0.1.0"
  • dep
  • vendor
  • go mod
11.00
12.00LUNCH
13.00 Exercises
  • ls DIR
  • react DIR
14.50
  • Questions and evaluation
15.00 END