$30 off During Our Annual Pro Sale. View Details »
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
480
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
230
Diet Hacks
nathany
2
380
Go 1.6 and HTTP/2
nathany
3
140
Upgrading Rails Redux
nathany
1
96
GopherCon recap
nathany
0
180
Go Functions
nathany
0
100
Go Arrays & Slices
nathany
0
150
Go Types
nathany
2
130
Other Decks in Technology
See All in Technology
MLflowダイエット大作戦
lycorptech_jp
PRO
1
120
Database イノベーショントークを振り返る/reinvent-2025-database-innovation-talk-recap
emiki
0
170
「図面」から「法則」へ 〜メタ視点で読み解く現代のソフトウェアアーキテクチャ〜
scova0731
0
120
Lessons from Migrating to OpenSearch: Shard Design, Log Ingestion, and UI Decisions
sansantech
PRO
1
130
生成AI活用の型ハンズオン〜顧客課題起点で設計する7つのステップ
yushin_n
0
160
第4回 「メタデータ通り」 リアル開催
datayokocho
0
130
Challenging Hardware Contests with Zephyr and Lessons Learned
iotengineer22
0
210
Oracle Cloud Infrastructure IaaS 新機能アップデート 2025/09 - 2025/11
oracle4engineer
PRO
0
120
手動から自動へ、そしてその先へ
moritamasami
0
300
学習データって増やせばいいんですか?
ftakahashi
2
330
寫了幾年 Code,然後呢?軟體工程師必須重新認識的 DevOps
cheng_wei_chen
1
1.4k
RAG/Agent開発のアップデートまとめ
taka0709
0
180
Featured
See All Featured
Bash Introduction
62gerente
615
210k
Why Our Code Smells
bkeepers
PRO
340
57k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Into the Great Unknown - MozCon
thekraken
40
2.2k
Facilitating Awesome Meetings
lara
57
6.7k
How to Ace a Technical Interview
jacobian
280
24k
How GitHub (no longer) Works
holman
316
140k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
970
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