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言語】オプション設定のベストプラクティス
Search
Tomoki Ota
July 25, 2024
Programming
0
270
【Go言語】オプション設定のベストプラクティス
Go言語のオプション設定方法について、解説しています。
【Qiita】
【Go言語】オプション設定のベストプラクティス
Tomoki Ota
July 25, 2024
Tweet
Share
More Decks by Tomoki Ota
See All by Tomoki Ota
アーキテクチャの価値
tomo1227
0
71
アーキテクチャとビジネスロジック
tomo1227
0
78
【Go言語】テスト
tomo1227
0
44
【Go言語】クロージャ
tomo1227
0
230
【Go言語】イテレータ
tomo1227
0
55
【Go言語】エラーハンドリング
tomo1227
0
50
AIに淘汰されないようにするには?
tomo1227
0
47
【Go言語】range
tomo1227
0
46
【Go言語】break
tomo1227
0
52
Other Decks in Programming
See All in Programming
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
3
760
「テストは愚直&&網羅的に書くほどよい」という誤解 / Test Smarter, Not Harder
munetoshi
0
170
Flutterで備える!Accessibility Nutrition Labels完全ガイド
yuukiw00w
0
160
20250628_非エンジニアがバイブコーディングしてみた
ponponmikankan
0
680
PHP 8.4の新機能「プロパティフック」から学ぶオブジェクト指向設計とリスコフの置換原則
kentaroutakeda
2
890
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
1
5.6k
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
1
18k
AIエージェントはこう育てる - GitHub Copilot Agentとチームの共進化サイクル
koboriakira
0
590
Result型で“失敗”を型にするPHPコードの書き方
kajitack
5
650
“いい感じ“な定量評価を求めて - Four Keysとアウトカムの間の探求 -
nealle
1
10k
A full stack side project webapp all in Kotlin (KotlinConf 2025)
dankim
0
120
チームで開発し事業を加速するための"良い"設計の考え方 @ サポーターズCoLab 2025-07-08
agatan
1
420
Featured
See All Featured
Being A Developer After 40
akosma
90
590k
Automating Front-end Workflow
addyosmani
1370
200k
Become a Pro
speakerdeck
PRO
29
5.4k
The Invisible Side of Design
smashingmag
301
51k
Practical Orchestrator
shlominoach
189
11k
What's in a price? How to price your products and services
michaelherold
246
12k
Navigating Team Friction
lara
187
15k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.9k
Music & Morning Musume
bryan
46
6.6k
Done Done
chrislema
184
16k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
6
300
How GitHub (no longer) Works
holman
314
140k
Transcript
Tomoki Ota ʲGoݴޠʳΦϓγϣϯઃఆͷϕετϓϥΫςΟε
HTTPαʔόͷ࡞ 2
HTTPαʔόͷ࡞ 3
GinͷNew() 4
ᶃγϯϓϧͳΦϓγϣϯઃఆ ᶄCon f igߏମ ᶅBuilderύλʔϯ ᶆؔΦϓγϣϯύλʔϯ ᶇDysfunctional Options Pattern ᶈ݁
ΞδΣϯμ
γϯϓϧͳΦϓγϣϯઃఆํ๏
7 γϯϓϧͳઃఆํ๏
γϯϓϧͳઃఆํ๏ debugͷઃఆΛՃ͢Δ
HTTPαʔόͷ࡞ 9 ΫϥΠΞϯτଆͰҾ͕Γͳͯ͘յΕΔ
γϯϓϧͳઃఆํ๏
Con f igߏମ
Con f igߏମ
Con f igߏମ 13
Con f igߏମ 14
Con f igߏମ 15
ࢦఆ͠ͳ͔ͬͨύϥϝʔλʹθϩ͕ೖΔ(ҙ ਤతʹ0Λೖͨ͠ͷ͔ɺະೖྗͳͷ͔ͷҧ͍͕ ͔Βͳ͍) Con f igߏମͷσϝϦοτ
ࢦఆ͠ͳ͔ͬͨύϥϝʔλʹθϩ͕ೖΔ(ҙ ਤతʹ0Λೖͨ͠ͷ͔ɺະೖྗͳͷ͔ͷҧ͍͕ ͔Βͳ͍) Con f igߏମͷσϝϦοτ ϙΠϯλΛ͏
Con f igߏମͷσϝϦοτ ϙΠϯλΛ͏
Con f igߏମͷσϝϦοτ σϑΥϧτΛ͏߹ۭΛ͢ඞཁ͕͋Δ
Builderύλʔϯ
Builderύλʔϯͱʁ GoFͷσβΠϯύλʔϯͷ̍ͭ ॊೈੑͷߴ͍ղܾࡦΛఏڙ͠ɺՄಡੑΛߴΊΔ
Builderύλʔϯ 22
Builderύλʔϯ 23
Builderύλʔϯ 24
Builderύλʔϯ GOʹJavaͷ@BuilderΑ͏ͳຐ๏ͳ͍ GoFͷσβΠϯύλʔϯͷ̍ͭͰ͋ΔBuilderύλʔϯ Λ༻͍Δ͜ͱͰɺॊೈੑͷߴ͍ղܾࡦΛఏڙ͞ΕΔɻ Builderύλʔϯͷॻ͖ํෳ͋Δɻ
Builderύλʔϯ 26
Builderύλʔϯ
BuilderύλʔϯͷσϝϦοτ Con f igߏମಉ༷ɺσϑΥϧτͷઃఆΛ༻͍ͨ͠߹ ۭͷߏମΛ͢ඞཁ͕͋Γɺݟӫ͕͑ѱ͍
ؔΦϓγϣϯύλʔϯ
Functional Optional Pattern ؔΦϓγϣϯύλʔϯՄมݸҾʹґଘ ͢Δ ؔΦϓγϣϯύλʔϯͱʁ
ؔΦϓγϣϯύλʔϯͱʁ
ؔΦϓγϣϯύλʔϯͱʁ
ؔΦϓγϣϯύλʔϯͱʁ σϑΥϧτΛઃఆ͍ͨ͠߹ઃఆ͢Δඞཁ͕ͳ͍
Dysfunctional Options Pattern
ؔΦϓγϣϯύλʔϯத͕ؒଟ͘ɺෳࡶͰ ͋Δͱ͍͏͜ͱΛࢹͨ͠ύλʔϯ Dysfunctional Options Patternͱʁ
Dysfunctional Options Pattern
BulderύλʔϯͷҰͭ Dysfunctional Options Patternͱʁ
Dysfunctional Options Patternͱʁ ނʹɺσϑΥϧτΛ༻͍ͨ͠߹ɺۭͷߏମΛ͢ඞཁ͕͋Γ·͢ɻ ނʹɺσϑΥϧτΛ༻͍ͨ͠߹ɺۭͷߏମΛ͞ͳ͚ΕͳΒͳ͍
݁
GoͰҰ൪׳༻తͰ·ΕΔͷɺؔΦϓγϣϯύλʔϯ Builderύλʔϯ࣮͍͕͢͠ɺσϑΥϧτΛઃఆ͢Δ ͱ͖ʹɺJavaͱҧͬͯบ͕͋Δ ݁
GoͰҰ൪׳༻తͰ·ΕΔͷɺؔΦϓγϣϯύλʔϯɻ Builderύλʔϯ࣮͍͚͢͠ͲɺJavaͱҧ͍ɺগ͠บ͕͋Γ· ͢ɻ ݁