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
84
【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
53
アーキテクチャとビジネスロジック
tomo1227
0
58
【Go言語】テスト
tomo1227
0
32
【Go言語】クロージャ
tomo1227
0
220
【Go言語】イテレータ
tomo1227
0
39
【Go言語】エラーハンドリング
tomo1227
0
41
AIに淘汰されないようにするには?
tomo1227
0
37
【Go言語】range
tomo1227
0
31
【Go言語】break
tomo1227
0
39
Other Decks in Programming
See All in Programming
ComposeでWebアプリを作る技術
tbsten
0
130
iOSアプリで測る!名古屋駅までの 方向と距離
ryunakayama
0
150
Thank you <💅>, What's the Next?
ahoxa
1
590
Cursorを活用したAIプログラミングについて 入門
rect
0
150
Golangci-lint v2爆誕: 君たちはどうすべきか
logica0419
1
230
インプロセスQAにおいて大事にしていること / In-process QA Meetup
medley
0
140
Rubyの!メソッドをちゃんと理解する
alstrocrack
1
120
カウシェで Four Keys の改善を試みた理由
ike002jp
1
120
プロダクト横断分析に役立つ、事前集計しないサマリーテーブル設計
hanon52_
3
530
Improve my own Ruby
sisshiki1969
0
100
読書シェア会 vol.4 『ダイナミックリチーミング 第2版』
kotaro666
0
110
Boost Your Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
750
Featured
See All Featured
Designing Experiences People Love
moore
142
24k
How GitHub (no longer) Works
holman
314
140k
Visualization
eitanlees
146
16k
Building a Modern Day E-commerce SEO Strategy
aleyda
40
7.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
45
7.2k
How to Think Like a Performance Engineer
csswizardry
23
1.6k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
RailsConf 2023
tenderlove
30
1.1k
Practical Orchestrator
shlominoach
187
11k
Java REST API Framework Comparison - PWX 2021
mraible
31
8.5k
Raft: Consensus for Rubyists
vanstee
137
6.9k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
34
2.2k
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