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
510
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Contributing to Go
Motivation and How-to for contributing to Go.
Nathan Youngman
May 26, 2014
More Decks by Nathan Youngman
See All by Nathan Youngman
The Healthy Programmer
nathany
2
120
Go and Node.js: a comparison
nathany
1
270
Diet Hacks
nathany
2
410
Go 1.6 and HTTP/2
nathany
3
170
Upgrading Rails Redux
nathany
1
110
GopherCon recap
nathany
0
210
Go Functions
nathany
0
120
Go Arrays & Slices
nathany
0
180
Go Types
nathany
2
150
Other Decks in Technology
See All in Technology
ペアプロの価値はコードを書くことだけじゃない
codmoninc
PRO
0
140
Webとヘルスデータ
yukukotani
1
200
Oracle Cloud Infrastructure IaaS 新機能アップデート 2026/6 - 2026/8
oracle4engineer
PRO
0
130
「図書館」という名前のままでいいのか -Code4Lib JAPANカンファレンス2026 アンカンファレンス報告- / Code4Lib JAPAN Conference 2026: Unconference Report
ykiyota
0
110
Tab5をRubyで動くパソコンにする
kishima
2
270
Bet AI Day 2026丨バクラク Autopilot、業務システムの再設計
layerx
PRO
2
1.6k
Bet AI Day 2026丨How We Bet AI: AIとともに働く場をつくる
layerx
PRO
2
2.8k
Microsoft 365 Copilot chat -tekoälypalvelun tietosuojaongelmat
hponka
0
560
少人数データチームのDevin活用実践事例
runandy16
3
460
Podは生きているのにGoだけが落ちる:GOGCとGOMEMLIMITで追うInvisible OOM Killの謎
tkc66buzz
1
210
日経電子版を支えていく Kasane Design System/fec_fukuoka
nikkei_engineer_recruiting
0
260
AI時代のAPI品質を支えるガードレール / API Guardrails for API quality in the AI era
yokawasa
1
170
Featured
See All Featured
Making Projects Easy
brettharned
120
6.7k
The Invisible Side of Design
smashingmag
301
52k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
510
Art, The Web, and Tiny UX
lynnandtonic
304
22k
The Cult of Friendly URLs
andyhume
79
7k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.9k
How to make the Groovebox
asonas
2
2.4k
Building an army of robots
kneath
306
46k
Site-Speed That Sticks
csswizardry
13
1.5k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.6k
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 <
[email protected]
> 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