Go(lang) - goatandsheep/goatandsheep.github.com GitHub Wiki
- pkg: internal libraries, i.e. homemade stuff
- vendor: dependencies
Dependency manager: dep
does not replace go get
https://golang.github.io/dep/docs/FAQ.html#does-dep-replace-go-get
dep ensure <library>
for libraries
go get ./...
pkg in tld is like compiled garbage of links like in C
Go will pull the top of master for each dependency, so using vendor will ensure the version you need is available.
Pass them only if you want to mutate the item directly
- Use
panic('error message')
sparingly: kills the entire application - Pipelining: Check for errors and bubble them up to the top
func(<structs you need>) FunctionName(<parameters>) <output type> {}
- cast: []string()
- convert: []string{}
- Marshall: doesn't take pointer, makes a copy
- Umarshall: takes a pointer, only returns error and mutates message