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
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
210
Diet Hacks
nathany
2
370
Go 1.6 and HTTP/2
nathany
3
130
Upgrading Rails Redux
nathany
1
91
GopherCon recap
nathany
0
180
Go Functions
nathany
0
100
Go Arrays & Slices
nathany
0
140
Go Types
nathany
2
130
Other Decks in Technology
See All in Technology
自治体職員がガバクラの AWS 閉域ネットワークを理解するのにやって良かった個人検証環境
takeda_h
2
360
OCI Bastionサービス
oracle4engineer
PRO
1
100
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
6.4k
あなたの知らない OneDrive
murachiakira
0
210
第64回コンピュータビジョン勉強会@関東(後編)
tsukamotokenji
0
210
datadog-distribution-of-opentelemetry-collector-intro
tetsuya28
0
220
Autonomous Database Serverless 技術詳細 / adb-s_technical_detail_jp
oracle4engineer
PRO
18
52k
認知戦の理解と、市民としての対抗策
hogehuga
0
200
サイボウズフロントエンドの横断活動から考える AI時代にできること
mugi_uno
4
1.3k
Amazon S3 Vectorsは大規模ベクトル検索を低コスト化するサーバーレスなベクトルデータベースだ #jawsugsaga / S3 Vectors As A Serverless Vector Database
quiver
2
1.1k
株式会社ARAV 採用案内
maqui
0
190
生成AI利用プログラミング:誰でもプログラムが書けると 世の中どうなる?/opencampus202508
okana2ki
0
180
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
95
14k
Building a Modern Day E-commerce SEO Strategy
aleyda
43
7.5k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3k
GraphQLとの向き合い方2022年版
quramy
49
14k
Docker and Python
trallard
45
3.5k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
For a Future-Friendly Web
brad_frost
179
9.9k
Making Projects Easy
brettharned
117
6.3k
Java REST API Framework Comparison - PWX 2021
mraible
33
8.8k
The Language of Interfaces
destraynor
160
25k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
A designer walks into a library…
pauljervisheath
207
24k
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