Last active
August 29, 2015 14:09
-
-
Save jandre/e3d3052d88a3e7335ed4 to your computer and use it in GitHub Desktop.
gomeetup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
build a go lib and binary | |
1. installing go | |
1. OS X: brew install go | |
2. Linux: https://github.com/dcoxall/vagrant-golang ? | |
3. organizing your code | |
1. GOPATH export GOPATH=/Users/jandre/godemo | |
2. WORKSPACE https://golang.org/doc/code.html | |
3. vim go (https://github.com/fatih/vim-go) | |
4. :GoInstallBinaries | |
5. code | |
1. create a lib (exporting functions) | |
1. package naming | |
2. exporting functions | |
3. how to build (go build) | |
3. create a binary that consumes lib | |
1. demo how goimports auto imports stuff from stdlib | |
2. package = main | |
5. create a tests (go test) | |
6. goroutines (NOT COVERED) | |
7. documentation | |
1. Use full sentences (e.g. https://github.com/tools/godep/blob/master/main.go#L13-L33) | |
2. godoc.org: e.g. http://godoc.org/github.com/jandre/procfs | |
9. importing other libraries (use debug example) and go get | |
10. structs, objects | |
11. pointers? | |
11. reflection? | |
12. managing dependencies (https://github.com/tools/godep) | |
1. how you want to organize things? e.g. using a makefile (to set GOPATH, setup deps, etc) | |
7. references! | |
1. http://www.golang-book.com/ | |
2. https://gist.github.com/jandre/8216047 | |
8. code examples | |
1. web stuff - gogs.io https://github.com/gogits/gogs | |
2. simple project to learn from: https://github.com/sourcegraph/go-papertrail/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment