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言語】値レシーバ v.s. ポインタレシーバ
Search
Tomoki Ota
August 02, 2024
Programming
0
35
【Go言語】値レシーバ v.s. ポインタレシーバ
Go言語の値レシーバ とポインタレシーバの違いについて、解説しています。
【Qiita】
https://qiita.com/twrcd1227/items/9994b345e96eaafaafe4
Tomoki Ota
August 02, 2024
Tweet
Share
More Decks by Tomoki Ota
See All by Tomoki Ota
アーキテクチャの価値
tomo1227
0
37
アーキテクチャとビジネスロジック
tomo1227
0
43
【Go言語】テスト
tomo1227
0
19
【Go言語】クロージャ
tomo1227
0
210
【Go言語】イテレータ
tomo1227
0
27
【Go言語】エラーハンドリング
tomo1227
0
29
AIに淘汰されないようにするには?
tomo1227
0
29
【Go言語】range
tomo1227
0
20
【Go言語】break
tomo1227
0
31
Other Decks in Programming
See All in Programming
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
180
DevFest - Serverless 101 with Google Cloud Functions
tunmise
0
140
Package Traits
ikesyo
1
220
Simple組み合わせ村から大都会Railsにやってきた俺は / Coming to Rails from the Simple
moznion
3
2.8k
asdf-ecspresso作って 友達が増えた話 / Fujiwara Tech Conference 2025
koluku
0
1.4k
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
1.4k
快速入門可觀測性
blueswen
0
500
毎日13時間もかかるバッチ処理をたった3日で60%短縮するためにやったこと
sho_ssk_
1
560
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
1.4k
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
400
CNCF Project の作者が考えている OSS の運営
utam0k
3
430
rails newと同時に型を書く
aki19035vc
6
730
Featured
See All Featured
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
580
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
39
1.9k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
3
360
Typedesign – Prime Four
hannesfritz
40
2.5k
Unsuck your backbone
ammeep
669
57k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
GitHub's CSS Performance
jonrohan
1030
460k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.4k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
Scaling GitHub
holman
459
140k
Transcript
Tomoki Ota ʲGoݴޠʳ Ϩγʔό V.S. ϙΠϯλϨγʔό
Ϩγʔό ϙΠϯλϨγʔό Ϩγʔό͕ϙΠϯλͰͳ͚ΕͳΒ͍ͱ͖ Ϩγʔό͕ϙΠϯλͰ͋Δ͖ͱ͖ Ϩγʔό͕Ͱͳ͚ΕͳΒ͍ͱ͖ Ϩγʔό͕Ͱ͋Δ͖ͱ͖ defer ·ͱΊ ΞδΣϯμ 2
Ϩγʔό 3
Ϩγʔόͷྫ 4
Ϩγʔόͷྫ 5
ϙΠϯλϨγʔό 6
ϙΠϯλϨγʔόͷྫ 7
ϙΠϯλϨγʔόͷྫ 8
Ϩγʔό͕ϙΠϯλͰ ͳ͚ΕͳΒ͍ͱ͖ 9
ϝιου͕ϨγʔόΛมߋ͢Δඞཁ͕͋Δͱ͖ ϝιουͷϨγʔό͕ίϐʔͰ͖ͳ͍ϑΟʔϧυΛؚΉͱ͖ Ϩγʔό͕ϙΠϯλͰͳ͚ΕͳΒ͍ͱ͖ 10
Ϩγʔό͕ϙΠϯλͰͳ͚ΕͳΒ͍ͱ͖ 11
Ϩγʔό͕ϙΠϯλͰ ͳ͚ΕͳΒ͍ͱ͖ 12
Ϩγʔό͕େ͖ͳͷͱ͖ → ͩ͠ͱίϐʔ͞Εͯ͠·͏ Ϩγʔό͕ϙΠϯλͰ͋Δ͖ͱ͖ 13
Ϩγʔό͕ϙΠϯλͰ ͳ͚ΕͳΒ͍ͱ͖ 14
ϨγʔόͷෆมੑΛڧ੍͢Δඞཁ͕͋Δͱ͖ Ϩγʔό͕Ϛοϓɺؔɺνϟωϧͷͱ͖ Ϩγʔό͕Ͱͳ͚ΕͳΒ͍ͱ͖ 15
Ϩγʔό͕ϙΠϯλͰ ͳ͚ΕͳΒ͍ͱ͖ 16
Ϩγʔό͕ɺมߋ͢Δඞཁͷͳ͍εϥΠεͷͱ͖ Ϩγʔό͕খ͞ͳྻɺՄมͳϑΟʔϧυΛ࣋ͨͣඞવతʹ ܕͰ͋Δtime.Time ͷΑ͏ͳߏମͷͱ͖ Ϩγʔό͕ intɺ f loat64ɺstring ͱ͍ͬͨجຊσʔλܕͷͱ͖ Ϩγʔό͕Ͱ͋Δ͖ͱ͖
17
Ϩγʔό͕Ͱ͋Δ͖ͱ͖ 18
defer 19
ϝιουʹରͯ͠ɺdeferΛ༻͢Δͱ͖ɺϨ γʔό͙͢ʹධՁ͞ΕΔ defer 20
defer 21
defer 22
·ͱΊ 23
ਖ਼ͳཧ༝͕ͳ͍ݶΓɺϨγʔόΛ༻͢Δ ͨͩ͠ɺ໎ͬͨͱ͖ϙΠϯλϨγʔόΛ͏ํ͕͍͍ deferͰϝιουΛ͏࣌ɺϙΠϯλΛ͘͢͠ɺ Ϋϩʔδϟ෦Ͱݺͼग़͢ͱଈ࣌ධՁ͞Εͳ͘ͳΔ ·ͱΊ 24