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
490
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
110
Go and Node.js: a comparison
nathany
1
240
Diet Hacks
nathany
2
390
Go 1.6 and HTTP/2
nathany
3
150
Upgrading Rails Redux
nathany
1
97
GopherCon recap
nathany
0
190
Go Functions
nathany
0
100
Go Arrays & Slices
nathany
0
150
Go Types
nathany
2
130
Other Decks in Technology
See All in Technology
Data Hubグループ 紹介資料
sansan33
PRO
0
2.7k
AWS Network Firewall Proxyを触ってみた
nagisa53
1
220
Azure Durable Functions で作った NL2SQL Agent の精度向上に取り組んだ話/jat08
thara0402
0
180
小さく始めるBCP ― 多プロダクト環境で始める最初の一歩
kekke_n
1
400
10Xにおける品質保証活動の全体像と改善 #no_more_wait_for_test
nihonbuson
PRO
2
240
MCPでつなぐElasticsearchとLLM - 深夜の障害対応を楽にしたい / Bridging Elasticsearch and LLMs with MCP
sashimimochi
0
160
茨城の思い出を振り返る ~CDKのセキュリティを添えて~ / 20260201 Mitsutoshi Matsuo
shift_evolve
PRO
1
250
クレジットカード決済基盤を支えるSRE - 厳格な監査とSRE運用の両立 (SRE Kaigi 2026)
capytan
6
2.7k
GitHub Issue Templates + Coding Agentで簡単みんなでIaC/Easy IaC for Everyone with GitHub Issue Templates + Coding Agent
aeonpeople
1
220
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
230
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
250
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
0
890
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
120
How STYLIGHT went responsive
nonsquared
100
6k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
340
The Art of Programming - Codeland 2020
erikaheidi
57
14k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
170
Paper Plane (Part 1)
katiecoart
PRO
0
4.1k
A better future with KSS
kneath
240
18k
GraphQLとの向き合い方2022年版
quramy
50
14k
HDC tutorial
michielstock
1
370
From π to Pie charts
rasagy
0
120
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