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
500
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
250
Diet Hacks
nathany
2
400
Go 1.6 and HTTP/2
nathany
3
170
Upgrading Rails Redux
nathany
1
110
GopherCon recap
nathany
0
200
Go Functions
nathany
0
120
Go Arrays & Slices
nathany
0
180
Go Types
nathany
2
140
Other Decks in Technology
See All in Technology
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
110k
ゴールデンパスは敷いただけでは道にならない ─ 企画部門のエンジニアが技術標準を事業価値に変えるまで
mhrtech
1
220
そのドキュメント、自動化しませんか?
yuksew
1
300
アップデートで何が変わった?デモで学んで使いこなすIBM Bob2.0
muehara
0
120
誤解だらけの開発生産性 / Myths and Misconceptions about Developer Productivity
i35_267
2
800
AI Driven AI Governance
pict3
0
490
10年目を迎えた「ABEMA」がどのように AI 活用を推進して、AI 駆動開発にシフトしているのか / How ABEMA, entering its 10th year, is promoting the use of AI and shifting toward AI-driven development
miyukki
0
280
インフラと開発の垣根を超えていき!〜元AWSインフラエンジニアがAWS開発で奮闘している話〜
hatahata021
3
300
脱金融のフューチャー・デザイン / Future Design Beyond Finance
ks91
PRO
0
160
穢れた技術選定について
watany
17
5.5k
OPENLOGI Company Profile for engineer
hr01
1
74k
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
8.4k
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.6k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
240
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
A Soul's Torment
seathinner
6
3.1k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
118
120k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
320
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
190
Evolving SEO for Evolving Search Engines
ryanjones
0
240
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
180
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