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
490
2
Share
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
250
Diet Hacks
nathany
2
390
Go 1.6 and HTTP/2
nathany
3
150
Upgrading Rails Redux
nathany
1
99
GopherCon recap
nathany
0
190
Go Functions
nathany
0
110
Go Arrays & Slices
nathany
0
160
Go Types
nathany
2
140
Other Decks in Technology
See All in Technology
終盤で崩壊させないAI駆動開発
j5ik2o
0
150
すごいぞManaged Kubernetes
harukasakihara
1
370
New CBs New Challenges
ysuzuki
1
160
Babylon.js を使って試した色々な内容 / Various things I tried using Babylon.js / Babylon.js 勉強会 vol.5
you
PRO
0
260
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」ご紹介資料
laysakura
0
1.6k
Bluesky Meetup in Tokyo vol.4 - 2023to2026
shinoharata
0
130
デシリアライゼーションを理解する / Inside Deserialization
tomzoh
0
190
見えない開発現場を、見える投資に変える
rojoudotcom
2
140
主催・運営として"場をつくる”というアウトプットのススメ
_mossann_t
0
130
ふりかえりを 「あそび」にしたら、 学習が勝手に進んだ / Playful Retros Drive Learning
katoaz
0
430
【PHPカンファレンス小田原2026】Webアプリケーションエンジニアにも知ってほしい オブザーバビリティ の本質
fendo181
0
500
機能・非機能の学びを一つに!Agent Skillsで月間レポート作成始めてみた / Unifying Bug & Infra Insights — Building Monthly Quality Reports with Agent Skills
bun913
5
3.8k
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
510
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
190
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
760
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
330
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
670
Building Flexible Design Systems
yeseniaperezcruz
330
40k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
680
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
68
38k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1k
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