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
16
【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
【Go言語】イテレータ
tomo1227
0
5
【Go言語】エラーハンドリング
tomo1227
0
8
AIに淘汰されないようにするには?
tomo1227
0
12
range.pdf
tomo1227
0
5
【Go言語】break
tomo1227
0
5
【Go言語】反復処理
tomo1227
0
4
【Go言語】map
tomo1227
0
16
【Go言語】値の比較
tomo1227
0
17
【Go言語】名前付き戻り値
tomo1227
0
13
Other Decks in Programming
See All in Programming
Scala におけるコンパイラエラーとの付き合い方
chencmd
2
410
XStateでReactに秩序を与えたい
gizm000
0
710
What you can do with Ruby on WebAssembly
kateinoigakukun
0
160
Prompt Cachingは本当に効果的なのか検証してみた.pdf
ttnyt8701
0
530
Kotlin 2.0 and Beyond
antonarhipov
2
150
Some more adventure of Happy Eyeballs
coe401_
2
180
Rubyのobject_id
qnighy
6
1.3k
Understand the mechanism! Let's do screenshots tests of Compose Previews with various variations / 仕組みから理解する!Composeプレビューを様々なバリエーションでスクリーンショットテストしよう
sumio
3
480
GoのIteratorに詳しくなってしまう
inatonix
1
200
実践!難読化ガイド
mitchan
0
120
長期運用プロダクトの開発速度を維持し続けるためのリファクタリング実践例
wataruss
8
2.7k
dotfiles について話したい #湘なんか
stefafafan
2
300
Featured
See All Featured
In The Pink: A Labor of Love
frogandcode
139
22k
Product Roadmaps are Hard
iamctodd
PRO
48
10k
Building Adaptive Systems
keathley
36
2.1k
Code Reviewing Like a Champion
maltzj
518
39k
Mobile First: as difficult as doing things right
swwweet
221
8.8k
Web development in the modern age
philhawksworth
204
10k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
502
140k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
157
15k
Creatively Recalculating Your Daily Design Routine
revolveconf
215
12k
What's in a price? How to price your products and services
michaelherold
242
11k
What the flash - Photography Introduction
edds
67
11k
Bootstrapping a Software Product
garrettdimon
PRO
304
110k
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