Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Contributing to Go
Search
Nathan Youngman
May 26, 2014
Technology
2
460
Contributing to Go
Motivation and How-to for contributing to Go.
Nathan Youngman
May 26, 2014
Tweet
Share
More Decks by Nathan Youngman
See All by Nathan Youngman
The Healthy Programmer
nathany
2
97
Go and Node.js: a comparison
nathany
1
180
Diet Hacks
nathany
2
350
Go 1.6 and HTTP/2
nathany
3
120
Upgrading Rails Redux
nathany
1
86
GopherCon recap
nathany
0
160
Go Functions
nathany
0
95
Go Arrays & Slices
nathany
0
130
Go Types
nathany
2
130
Other Decks in Technology
See All in Technology
17年のQA経験が導いたスクラムマスターへの道 / 17 Years in QA to Scrum Master
toma_sm
0
510
デザインシステムのレガシーコンポーネントを刷新した話/Design System Legacy Renewal
kaonavi
0
140
滑らかなユーザー体験も目指す注文管理のマイクロサービス化〜注文情報CSVダウンロード機能の事例〜
demaecan
0
130
ウォンテッドリーにおける Platform Engineering
bgpat
0
180
改めて学ぶ Trait の使い方 / phpcon odawara 2025
meihei3
1
150
こんなデータマートは嫌だ。どんな? / waiwai-data-meetup-202504
shuntak
3
960
30 代子育て SRE が考える SRE ナレッジマネジメントの現在と将来
kworkdev
PRO
0
180
入社後SREチームのミッションや課題の整理をした話
morix1500
1
230
GitHub MCP Serverを使って Pull Requestを作る、レビューする
hiyokose
2
600
ペアプログラミングにQAが加わった!職能を超えたモブプログラミングの事例と学び
tonionagauzzi
1
160
出前館を支えるJavaとKotlin
demaecan
0
150
コンソールで学ぶ!AWS CodePipelineの機能とオプション
umekou
3
130
Featured
See All Featured
Designing for humans not robots
tammielis
251
25k
YesSQL, Process and Tooling at Scale
rocio
172
14k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
49k
How STYLIGHT went responsive
nonsquared
99
5.4k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.3k
Become a Pro
speakerdeck
PRO
27
5.2k
How to Ace a Technical Interview
jacobian
276
23k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
17
1.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
46
2.4k
Optimising Largest Contentful Paint
csswizardry
35
3.2k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Transcript
! Contributing to Go @nathany
Motivation even better tools
go.tools/cover
Naming things func validateFlags() error “notice that the purpose of
this is to set up state; the validation is secondary. it's misnamed.” - r
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
None
Code style pathsToRemove := make([]string, 0) ! “Just write: !
var pathsToRemove []string” - iant! https://code.google.com/p/go-wiki/wiki/CodeReviewComments
Effective use of the standard library ! atomic.AddInt32(&c.val, 1) !
“use ioutil.TempDir to create a unique root for this test run” - dfc!
– rsc “The goal here should be to expose the
minimal necessary functionality that lets people build useful things…” API design
– 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…
– rsc “There is no testing benefit here to the
interface over a simple struct with only public fields.” Keep it simple
–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
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
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
go.tools • godoc • vet • cover • oracle •
goimports go get code.google.com/p/go.tools/cmd/godoc
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
hg pull hg update hg update release hg update
default
rietveld “not the same as using standard Mercurial” # .hg/hgrc
[extensions] codereview = ~/go/lib/codereview/codereview.py [ui] username = Your Name <you@server.dom> tip.golang.org/doc/contribute.html
rietveld hg help codereview hg code-login ! # code, code,
code hg add myfile.go
review hg ksdiff ./all.bash ! godoc -http=:8080 ! hg change
www.kaleidoscopeapp.com
CL
PTAL hg sync hg mail 999999 ! hg upload
999999
LGTM Submitted