Slide 1

Slide 1 text

! Contributing to Go @nathany

Slide 2

Slide 2 text

Motivation even better tools

Slide 3

Slide 3 text

go.tools/cover

Slide 4

Slide 4 text

Naming things func validateFlags() error “notice that the purpose of this is to set up state; the validation is secondary. it's misnamed.” - r

Slide 5

Slide 5 text

Error messages "phrasing: say what's wrong, not how to fix it.” ! return fmt.Errorf("unexpected argument provided”) “this isn't quite right. "extra argument"? "too many arguments"?” - r

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Code style pathsToRemove := make([]string, 0) ! “Just write: ! var pathsToRemove []string” - iant! https://code.google.com/p/go-wiki/wiki/CodeReviewComments

Slide 8

Slide 8 text

Effective use of the standard library ! atomic.AddInt32(&c.val, 1) ! “use ioutil.TempDir to create a unique root for this test run” - dfc!

Slide 9

Slide 9 text

– rsc “The goal here should be to expose the minimal necessary functionality that lets people build useful things…” API design

Slide 10

Slide 10 text

– rsc “The problem with callbacks is that you now have to worry about user code blocking (or panicking) a library goroutine. ! A channel is a much better separation.” I hadn’t considered…

Slide 11

Slide 11 text

– rsc “There is no testing benefit here to the interface over a simple struct with only public fields.” Keep it simple

Slide 12

Slide 12 text

–Chad Fowler “Pick an open source project that you admire and whose developers appear to be at that "next level" you’re looking to reach.” Motivation

Slide 13

Slide 13 text

Go source # Mac
 xcode-select --install
 brew install hg
 
 hg clone https://code.google.com/p/go
 cd go/src
 ./all.bash golang.org/doc/install/source

Slide 14

Slide 14 text

CLA # .bashrc/.zshrc
 export GOPATH=$HOME/project
 export PATH=$PATH:$HOME/go/bin:$HOME/project/bin
 Contributor License Agreement golang.org/doc/contribute.html#copyright GOPATH

Slide 15

Slide 15 text

go.tools • godoc • vet • cover • oracle • goimports go get code.google.com/p/go.tools/cmd/godoc

Slide 16

Slide 16 text

CDPATH # .bashrc
 export CDPATH=.:$HOME/go/src/pkg:$GOPATH/ src/code.google.com/p
 
 # .zshrc
 setopt auto_cd
 cdpath=($HOME/go/src/pkg $GOPATH/src/ code.google.com/p) cd net/http

Slide 17

Slide 17 text

hg pull
 hg update
 
 hg update release hg update default

Slide 18

Slide 18 text

rietveld “not the same as using standard Mercurial” # .hg/hgrc
 [extensions]
 codereview = ~/go/lib/codereview/codereview.py
 
 [ui]
 username = Your Name tip.golang.org/doc/contribute.html

Slide 19

Slide 19 text

rietveld hg help codereview
 hg code-login ! # code, code, code hg add myfile.go

Slide 20

Slide 20 text

review hg ksdiff
 ./all.bash ! godoc -http=:8080 ! hg change www.kaleidoscopeapp.com

Slide 21

Slide 21 text

CL

Slide 22

Slide 22 text

PTAL hg sync
 
 hg mail 999999 ! hg upload 999999

Slide 23

Slide 23 text

LGTM Submitted