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
Go Proverbs の紹介
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
uji
July 27, 2025
Technology
190
2
Share
Go Proverbs の紹介
2025-07-27 Kanazawa.go オフライン集Go会 #5
uji
July 27, 2025
More Decks by uji
See All by uji
【Go ハンズオン】Windows / Linux コマンドを Go で再現
uji
1
100
testdata ディレクトリを活用しよう!
uji
1
380
MCP 公式の Go SDK で QA データ登録アシスタントを作ってみた
uji
0
160
Green Tea GCの動作を紙芝居にしてみる
uji
1
160
Go標準の暗号ライブラリメンテナンス戦略
uji
3
740
NOT A HOTEL TECH TALK ーSOFTWARE 3.0への道筋ー NEXT Web3 (2024-08-07)
uji
0
240
マネーフォワード ME ブロックチェーン連携機能におけるGoの活用方法
uji
1
290
Goはブロックチェーン領域でなぜ使われ、どのように活躍しているのか
uji
1
800
標準パッケージ初のgenerics利用事例 "sync/atomic.Pointer"
uji
2
1k
Other Decks in Technology
See All in Technology
20260428_Product Management Summit_tadokoroyoshiro
tadokoro_yoshiro
14
15k
Good Enough Types: Heuristic Type Inference for Ruby
riseshia
1
310
AIを共同作業者にして書籍を執筆する方法 / How to Write a Book with AI as a Co-Creator
ama_ch
2
150
データを"持てない"環境でのアノテーション基盤設計
sansantech
PRO
1
150
Expiration of Secure Boot Certificates for vSphere Virtual Machines
mirie_sd
0
110
弁護士ドットコム株式会社 エンジニア職向け 会社紹介資料
bengo4com
1
180
Pure Intonation on Browser: Building a Sequencer with Ruby
nagachika
0
160
Revisiting [CLS] and Patch Token Interaction in Vision Transformers
yu4u
0
400
PicoRuby as a Multi-VM Operating System
kishima
1
210
「誰一人取り残されない」 AIエージェント時代のプロダクト設計思想 Product Management Summit 2026
mizushimac
1
1.6k
独断と偏見で試してみる、 シングル or マルチエージェント どっちがいいの?
shichijoyuhi
1
150
社内エンジニア勉強会の醍醐味と苦しみ/tamadev
nishiuma
0
240
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
432
67k
SEO for Brand Visibility & Recognition
aleyda
0
4.5k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
140
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
240
A Soul's Torment
seathinner
6
2.7k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
Faster Mobile Websites
deanohume
310
31k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
180
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
Transcript
Go Proverbs の紹介 2025-07-27 Kanazawa.go オフライン集Go会 #5
⾃⼰紹介 • 名前: uji • 神⼾市在住 • NOT A HOTEL
所属 • Gopher 7年⽣ • KOBE.go, Kyoto.go 運営 https://twitter.com/uji_rb
Kyoto.go KOBE.go
Go⾔語の • プログラミング哲学 • ベストプラクティス を古くからあるGoの「格⾔」になぞらえて 紹介されたもの Go Proverbs とは?
https://go-proverbs.github.io/
Rob Pike⽒(Go⾔語の主要な設計者の⼀⼈「Goの⽗」) によるGopherfest 2015での講演などから抜粋 Go Proverbs とは? https://www.youtube.com/watch?v=PAAkCSZUG1c
いくつか抜粋
The bigger the interface, the weaker the abstraction.
インターフェースは同じメソッド(機能)を持つ複数の型 を、ひとくくりにして間接的に扱うための仕組み The bigger the interface, the weaker the abstraction.
インターフェースの代表例 io.Reader
The bigger the interface, the weaker the abstraction. Goにおいては、インターフェースは機能を絞り込み、でき るだけ⼩さく保つべきという⽂化が存在
機能が多い抽象度の低いインターフェースは それを満たすための実装が⼤変になり、再利⽤されなくなる インターフェースがより汎⽤的で再利⽤可能になり、結果 としてより強⼒で柔軟な抽象化が実現される
A little copying is better than a little dependency.
The bigger the interface, the weaker the abstraction. 「コードの再利⽤を最も重視する」という⽅針は 悪い考え、という教え
他ライブラリを安易にインポートすることで、 本来不要な依存関係を⽣み出すことへの懸念を⽰す
例: strconv パッケージ strconv はルーン⽂字列がPrint可能かどうかを判断する isPrint 関数を必要とするが、この機能のためだけに unicode パッケージ全体をインポートすると、⼤きな依存関係が発 ⽣する(約150キロバイト)
独⾃の isPrint の実装を持つことで、 ⼤きな依存関係のオーバーヘッドを回避している The bigger the interface, the weaker the abstraction. https://github.com/golang/go/blob/master/src/strconv/makeisprint.go
「意味があるならコピーすることを恐れるな」 不要な依存関係を避けることで、より堅牢で管理しやすい コードベースを構築することができる The bigger the interface, the weaker the
abstraction.
Don't panic.
Don't panic. Goでは、panic関数を呼び出すことで 実⾏時エラーとしてプログラムを終了させることができる
本当に継続不可能になる場⾯以外では使うべきでない。 エラーを返すことで、呼び出し元が関数のシグネチャから エラーの発⽣を予測でき、 適切に処理することが強制されるので プログラムの堅牢性が⾼まる Don't panic.
まとめ GoのプラクティスやGo⾃体の設計思想を知っておけると、 Goのエコシステムの恩恵を受けた開発がしやすくなる どうやって学べる? • Goの標準パッケージのドキュメントやコードを読む • Go Blog や、Goエコシステム設計‧開発者の発信を⾒る
イラスト: ©tottie / Renée French