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
Keep packages backwards compatible
Search
Ernesto Jiménez
February 05, 2017
Programming
0
140
Keep packages backwards compatible
FOSDEM 2017 talk on keeping Go packages backwards compatible
Ernesto Jiménez
February 05, 2017
Tweet
Share
More Decks by Ernesto Jiménez
See All by Ernesto Jiménez
From Zero to 400 webhooks/second in 24 hours
ernesto_jimenez
0
110
Learning Go - Build your first Slack app using Go and App Engine
ernesto_jimenez
0
170
Inception. Go programs that generate Go code
ernesto_jimenez
3
450
Other Decks in Programming
See All in Programming
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
180
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
640
実はマルチモーダルだった。ブラウザの組み込みAI🧠でWebの未来を感じてみよう #jsfes #gemini
n0bisuke2
3
1.4k
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
200
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
310
2年のAppleウォレットパス開発の振り返り
muno92
PRO
0
180
Vibe codingでおすすめの言語と開発手法
uyuki234
0
160
gunshi
kazupon
1
140
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
0
1.2k
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
430
JETLS.jl ─ A New Language Server for Julia
abap34
2
470
脳の「省エネモード」をデバッグする ~System 1(直感)と System 2(論理)の切り替え~
panda728
PRO
0
130
Featured
See All Featured
From π to Pie charts
rasagy
0
100
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.8k
What's in a price? How to price your products and services
michaelherold
246
13k
ラッコキーワード サービス紹介資料
rakko
0
1.9M
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
130
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
71k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
92
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
76
Prompt Engineering for Job Search
mfonobong
0
140
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
250
Transcript
keep packages backwards compatible
some tips
Small APIs commit to everything you export
Export fewer interfaces
package example type Service interface { Process() } func New()
Service { return &service{} }
package example type Service interface { Process() NewMethod() // ⚡
} func New() Service { return &service{} }
Receive interfaces Return structs
package example type Service struct { // ... } func
New() *Service { return &Service{} }
Export your input interfaces
package example func Process(in input) error { // ... }
// ⚠ type input interface { // ... }
None
// Input exported for documentation type Input interface { //
... } func Process(in Input) error { // ... }
Keeping interfaces to yourself
package testing type TB interface { Error(args ...interface{}) Fail() //
... // contains filtered or unexported methods }
package testing type TB interface { Error(args ...interface{}) Fail() //
... // A private method to prevent users implementing // interface and so future additions to it will // violate Go 1 compatibility. private() }
Nice optional params
cr, _ := crawler.New() cr.Crawl("http://godoc.org", process)
cr, _ := crawler.New( crawler.WithAllowedHosts("godoc.org"), ) cr.Crawl("http://godoc.org", process)
cr, _ := crawler.New( crawler.WithAllowedHosts("godoc.org"), crawler.WithMaxDepth(4), ) cr.Crawl("http://godoc.org", process)
func New(opts ...Option) (*Simple, error) type Option func(*options) error type
options struct
// WithMaxDepth sets the max depth of the crawl func
WithMaxDepth(depth int) Option { return func(opts *options) error { if depth < 0 { return fmt.Errorf("invalid depth: %d", depth) } opts.maxDepth = depth return nil } }
None
Be backwards compatible!
twitter.com/ernesto_jimenez
[email protected]