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
4
【Go言語】break
tomo1227
0
5
【Go言語】反復処理
tomo1227
0
3
【Go言語】map
tomo1227
0
16
【Go言語】値の比較
tomo1227
0
16
【Go言語】名前付き戻り値
tomo1227
0
13
Other Decks in Programming
See All in Programming
Debugging: All you need to know (for simultaneous interpreting)
jmatsu
2
410
Rechartsで楽にゴリゴリにカスタマイズする!
10tera
1
160
What we keep in mind when migrating from Serverless Framework to AWS CDK and AWS SAM
kasacchiful
1
140
【TID2024】模擬講義:プログラマと一緒にゲームをデザインしてみよう!
akatsukigames_tech
0
530
The Shape of a Service Object
inem
0
430
Ruby Parser progress report 2024
yui_knk
2
200
Kotlin 2.0 and Beyond
antonarhipov
2
140
いつか使える ObjectSpace / Maybe useful ObjectSpace
euglena1215
2
130
Mastering AsyncSequence - 使う・作る・他のデザインパターン(クロージャ、Delegate など)から移行する
treastrain
4
1.5k
rbs-inlineを導入してYARDからRBSに移行する
euglena1215
1
230
Go Code Generation at newmo / 2024-08-27 #newmo_layerx_go
genkey6
0
550
React + TextAliveでカッコいいLyric Applicatioinを作ろう!!
tosuri13
0
390
Featured
See All Featured
Infographics Made Easy
chrislema
239
18k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.2k
Building Applications with DynamoDB
mza
89
6k
Build your cross-platform service in a week with App Engine
jlugia
228
18k
5 minutes of I Can Smell Your CMS
philhawksworth
201
19k
Designing for Performance
lara
604
68k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
29
2.6k
Testing 201, or: Great Expectations
jmmastey
36
7k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
123
18k
Being A Developer After 40
akosma
83
580k
The Cost Of JavaScript in 2023
addyosmani
41
5.2k
The Straight Up "How To Draw Better" Workshop
denniskardys
230
130k
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