Go First Steps
Setup Golang Envionment and IDE
Install go
Install tools
go get -u -v github.com/nsf/gocode
go get -u -v github.com/rogpeppe/godef
go get -u -v golang.org/x/tools/cmd/goimports
go get -u -v golang.org/x/tools/cmd/oracle
go get -u -v golang.org/x/tools/cmd/gorename
Sublime
- Getting started and keyboard shortcuts
- Best of: Features, Plugins and Settings
- Keyboard shortcut to comment lines
Plugins for Sublime:
- git
- relatively new - but the official plugin:
-
maybe totally unnecessary: https://packagecontrol.io/packages/GoTools
- all plugins available: https://packagecontrol.io/search/golang
intro
https://www.youtube.com/watch?v=hha7d97VYkM
setup ide
- https://golang.org/doc/code.html
- http://dave.cheney.net/2014/12/01/five-suggestions-for-setting-up-a-go-project
testing and tdd
e.g. fib performance tests: http://dave.cheney.net/2013/06/09/writing-table-driven-tests-in-go https://github.com/davecheney/fib/blob/master/fib_test.go
http://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go
https://www.binpress.com/tutorial/getting-started-with-go-and-test-driven-development/160
https://www.binpress.com/tutorial/getting-started-with-go-and-test-driven-development/160
reference
https://golang.org/ref/spec (e.g. https://golang.org/ref/spec#Comparison_operators)
make vs new
Variable Types
reference types:
- maps
- slices
-
pointers
var m map[string]int
m = make(map[string]int)
slices - slices vs arrays
https://blog.golang.org/go-slices-usage-and-internals
map
https://blog.golang.org/go-maps-in-action
json
https://blog.golang.org/json-and-go https://www.youtube.com/watch?v=2rHgpx2gClk
code review comments
https://github.com/golang/go/wiki/CodeReviewComments
profiling
http://blog.golang.org/profiling-go-programs
If you have no ideas what to code, look here e.g. https://projecteuler.net/archives