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のソースコードから読み解くオブジェクト指向プログラミング@Object-Oriented ...
Search
arakawa
February 11, 2020
Programming
5
1k
Goのソースコードから読み解くオブジェクト指向プログラミング@Object-Oriented Conference 2020
arakawa
February 11, 2020
Tweet
Share
More Decks by arakawa
See All by arakawa
Goでテキストエディタを作った話@GDG Devfest2020
adsholoko
0
200
Other Decks in Programming
See All in Programming
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.6k
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
プロダクトの品質に コミットする / Commit to Product Quality
pekepek
2
760
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
180
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
620
103 Early Hints
sugi_0000
1
220
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
610
From Translations to Multi Dimension Entities
alexanderschranz
2
130
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
180
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
250
CSC509 Lecture 14
javiergs
PRO
0
130
Featured
See All Featured
A Philosophy of Restraint
colly
203
16k
Mobile First: as difficult as doing things right
swwweet
222
9k
GraphQLとの向き合い方2022年版
quramy
44
13k
Visualization
eitanlees
146
15k
For a Future-Friendly Web
brad_frost
175
9.4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
160
Optimising Largest Contentful Paint
csswizardry
33
3k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Transcript
0CKFDU0SJFOUFE$POGFSFODF !͓ͷਫঁࢠେֶڞ (Pͷιʔείʔυ͔ΒಡΈղ͘ ΦϒδΣΫτࢦϓϩάϥϛϯά BETIPMPLP BETIPMPLP
ࣗݾհ 4IPHP"SBLBXB J04&OHJOFFS !4BOTBO BETIPMPLP BETIPMPLP
ࠓ͢͜ͱ w (Pͷιʔείʔυͷઃܭ͔ΒΦϒδΣΫτࢦͷΤοηϯεΛֶ΅͏ w ΦϒδΣΫτࢦͷҰͰ͋ΔσβΠϯύλʔϯʹ͍ͭͯ͠·͢ ϘτϜΞοϓͰΦϒδΣΫτࢦͷਅΛֶͿ
(Pʹ͍ͭͯ w (PPHMF͕։ൃͨ͠ݴޠ w ݄ʹॳϦϦʔε w 3PC1JLFɺ,FO5PNQTPOʢݩ6/*9 ։ൃऀʣΒ͕ॳظઃܭͨ͠੩తܕ͚ݴޠ w ͭ·Γ6/*9ͷΤοηϯε͕٧·͍ͬͯΔ
ͦͦʜ (PΦϒδΣΫτࢦݴޠ͔ʁ
(PΦϒδΣΫτࢦݴޠʁ https://golang.org/doc/faq
(PΦϒδΣΫτࢦݴޠʁ https://golang.org/doc/faq
l:FTBOEOP"MUIPVHI(PIBTUZQFTBOENFUIPETBOE BMMPXTBOPCKFDUPSJFOUFETUZMFPGQSPHSBNNJOH UIFSF JTOPUZQFIJFSBSDIZ5IFDPODFQUPGlJOUFSGBDFzJO(P QSPWJEFTBEJGGFSFOUBQQSPBDIUIBUXFCFMJFWFJTFBTZ UPVTFBOEJOTPNFXBZTNPSFHFOFSBM5IFSFBSFBMTP XBZTUPFNCFEUZQFTJOPUIFSUZQFTUPQSPWJEF TPNFUIJOHBOBMPHPVTCVUOPUJEFOUJDBMUP TVCDMBTTJOH.PSFPWFS NFUIPETJO(PBSFNPSF
HFOFSBMUIBOJO$ PS+BWBz *T(PBOPCKFDUPSJFOUFEMBOHVBHF
l:FTBOEOP"MUIPVHI(PIBTUZQFTBOENFUIPETBOE BMMPXTBOPCKFDUPSJFOUFETUZMFPGQSPHSBNNJOH UIFSF JTOPUZQFIJFSBSDIZ5IFDPODFQUPGlJOUFSGBDFzJO(P QSPWJEFTBEJGGFSFOUBQQSPBDIUIBUXFCFMJFWFJTFBTZ UPVTFBOEJOTPNFXBZTNPSFHFOFSBM5IFSFBSFBMTP XBZTUPFNCFEUZQFTJOPUIFSUZQFTUPQSPWJEF TPNFUIJOHBOBMPHPVTCVUOPUJEFOUJDBMUP TVCDMBTTJOH.PSFPWFS NFUIPETJO(PBSFNPSF
HFOFSBMUIBOJO$ PS+BWBz *T(PBOPCKFDUPSJFOUFEMBOHVBHF
w ಡΈࠐΈॲཧΛಁաతʹѻ͏ͨΊͷ3FBEFSʢඪ४ϥΠϒϥϦΑΓʣ w ࠪΛݡ͘ಁաతʹѻ͏ͨΊͷ7JTJUPSʢݴޠॲཧܥΑΓʣ ࠓճհ͢Δύλʔϯ
w ಡΈࠐΈॲཧΛಁաతʹѻ͏ͨΊͷ3FBEFSʢඪ४ϥΠϒϥϦΑΓʣ w ࠪΛݡ͘ಁաతʹѻ͏ͨΊͷ7JTJUPSʢݴޠॲཧܥΑΓʣ ࠓճհ͢Δύλʔϯ
JP3FBEFSΠϯλʔϑΣʔε
JP3FBEFSΠϯλʔϑΣʔε Ҿ Γ
ྫϑΝΠϧಡΈࠐΈͷྫ
3FBEFSΠϯλʔϑΣʔε ଞʹͨ͘͞Μ͋ΔΑʂ JOUFSGBDF JP3FBEFS 3FBE Q<>CZUF OJOU FSSFSSPS CVpP3FBEFS
3FBE Q<>CZUF OJOU FSSFSSPS PT'JMF 3FBE Q<>CZUF OJOU FSSFSSPS OFU*1$POO 3FBE Q<>CZUF OJOU FSSFSSPS
ϑΝΠϧ͔ΒಡΈࠐΈΛ࣮ݱ͢Δ3FBEFS 3FBEFSΠϯλʔϑΣʔε JOUFSGBDF JP3FBEFS 3FBE Q<>CZUF O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࣋ͭ w ϑΟʔϧυʹೖ͞Ε͍ͯΔ۩Ϋ ϥεʹҰؔ༩͠ͳ͍ CVpPHP CVpP3FBEFS
ϑΝΠϧʹͯ͠ 3FBEFS͑͞ܧঝ͍ͯ͠Ε ԿͰࠩ͠ସ͑ΒΕΔ CVpP3FBEFS JOUFSGBDF JP3FBEFS JOUFSGBDF JP3FBEFS PT'JMF
ίωΫγϣϯʹͯ͠ 3FBEFS͑͞ܧঝ͍ͯ͠Ε ԿͰࠩ͠ସ͑ΒΕΔ CVpP3FBEFS JOUFSGBDF JP3FBEFS JOUFSGBDF JP3FBEFS OFU*1$POO
ࣗ࡞3FBEFSʹͯ͠ 3FBEFS͑͞ܧঝ͍ͯ͠Ε ԿͰࠩ͠ସ͑ΒΕΔ CVpP3FBEFS JOUFSGBDF JP3FBEFS JOUFSGBDF JP3FBEFS ࣗ࡞3FBEFS
"UPVSPG(P305
JP3FBEFSͷԿ͕خ͍͔͠ʁ w ݺͼग़͠ݩ͔Β͢ΕಡΈग़͠ݩͷιʔεΛҰҙࣝͤͣʹ͢Ή w JP3FBEFSʹ४ڌ͢Δͱಁաతʹ༷ʑͳػೳΛ֦ு͢Δ͜ͱ͕ग़དྷΔ w FH όοϑΝ͋Γ ϑΝΠϧιέοτΈ߹Θͤແݶେʂ ˞(P'ͷσβΠϯύλʔϯͰݴ͑$PNQPTJUF4UBSBUFHZύλʔϯʹ͍͔ۙ
w ಡΈࠐΈॲཧΛಁաతʹѻ͏ͨΊͷ3FBEFSʢඪ४ϥΠϒϥϦΑΓʣ w ࠪΛݡ͘ಁաతʹѻ͏ͨΊͷ7JTJUPSʢݴޠॲཧܥΑΓʣ ࠓճհ͢Δύλʔϯ
ίϯύΠϥͷಈ͖ ιʔείʔυ ࣈ۟ղੳ ߏจղੳ ҙຯղੳ ࠷దԽ ࣮ߦϑΝΠϧग़ྗ ˞࣮ࡍ͏গ͠ෳࡶͰ͢
ίϯύΠϥͷಈ͖ ̑ ιʔείʔυ ࣈ۟ղੳ ߏจղੳ ҙຯղੳ ࠷దԽ
࣮ߦϑΝΠϧग़ྗ <̑ >
ίϯύΠϥͷಈ͖ ιʔείʔυ ࣈ۟ղੳ ߏจղੳ ҙຯղੳ ࠷దԽ ࣮ߦϑΝΠϧग़ྗ <̑
> ˎ
ίϯύΠϥͷಈ͖ ιʔείʔυ ࣈ۟ղੳ ߏจղੳ ҙຯղੳ ࠷దԽ ࣮ߦϑΝΠϧग़ྗ
ˎ ׂѪ
ߏΛ८ճ͍ͨ͠ ˎ Λ͍͍ײ͡ʹ८ճͭͭ͠ɺͦͷϊʔυʹैͬͨॲཧΛ͍ͨ͠
ߏΛ८ճ͍ͨ͠ w 7JTJUPSΛ८ճ͢Δ w /PEF֤અΛදݱ͢Δ w &YQS/PEFΛ֦ுͨ͠Πϯ λʔϑΣʔε BTUXBMLHP BTUBTUHP
/PEFͷछྨͨͪ ˎ /PEF
/PEFͷछྨͨͪ ˎ &YQS
/PEFͷछྨͨͪ JOUFSGBDF /PEF JOUFSGBDF &YQS JOUFSGBDF %FDM #BTJD-JU FH Ϧςϥϧ
#JOBSZ&YQS FH ೋ߲ԋࢉࢠ *EFOU FH ม ʜ JOUFSGBDF 4UNU
/PEFͷछྨͨͪ ˎ #JOBSZ&YQS #BTJD-JU
#BTJD-JU
#JOBSZ&YQS
८ճ 8BML ͷಈ͖ ˎ 7JTJUPS
८ճ 8BML ͷಈ͖ ˎ 7JTJUPS
८ճ 8BML ͷಈ͖ ˎ 7JTJUPS
८ճ 8BML ͷಈ͖ ˎ 7JTJUPS 9 :
८ճ 8BML ͷಈ͖ ˎ 7JTJUPS 9 :
८ճ 8BML ͷಈ͖ ˎ 7JTJUPS
८ճ 8BML ͷಈ͖ ˎ 7JTJUPS 9 :
८ճ 8BML ͷಈ͖ ˎ 7JTJUPS
८ճ 8BML ͷಈ͖ ˎ 7JTJUPS 9 :
८ճ 8BML ͷಈ͖ ˎ 7JTJUPS
Կ͕خ͍͠ͷ͔ʁ w ८ճͱ๚࣌ͷϊʔυૢ࡞ͷͷ͕Ͱ͖Δ͜ͱ w ८ճͲͷछྨͷϊʔυ͔ʹؔ༩ͤͣಁաతͳΞΫηε͕Ͱ͖Δ w ֤ϊʔυ͝ͱʹઐ༻ͷॲཧΛॻ͘ͷͰίʔυͷݟ௨͕͠ྑ͍ w ϊʔυૢ࡞ʢ7JTJUʣΛϢʔβ͕֦ு͢Δ͜ͱ͕Ͱ͖Δ ˞(P'ͷσβΠϯύλʔϯͰݴ͑7JTJUPSύλʔϯʹ͍͕ۙɺશʹҰக͍ͯ͠ΔΘ͚Ͱͳ͍
ࠓճհͨ͠ύλʔϯ w ಡΈࠐΈॲཧΛಁաతʹѻ͏ͨΊͷ3FBEFSʢඪ४ϥΠϒϥϦΑΓʣ w ࠪΛݡ͘ಁաతʹѻ͏ͨΊͷ7JTJUPSʢݴޠॲཧܥΑΓʣ
Ͳ͕͜ΦϒδΣΫτࢦͩͬͨͷ͔ʁ
w ಡΈࠐΈॲཧΛಁաతʹѻ͏ͨΊͷ3FBEFSʢඪ४ϥΠϒϥϦΑΓʣ w ࠪΛݡ͘ಁաతʹѻ͏ͨΊͷ7JTJUPSʢݴޠॲཧܥΑΓʣ Ͳ͕͜ΦϒδΣΫτࢦͩͬͨͷ͔ʁ ݺͼग़͠ݩ͔Βৄࡉͷ࣮Λҙࣝ͠ͳ͍ ৄࡉͦͷੑ࣭͝ͱʹಈ࡞͢Δ
Ͳ͕͜ΦϒδΣΫτࢦͩͬͨͷ͔ʁ w ಡΈࠐΈॲཧΛಁաతʹѻ͏ͨΊͷ3FBEFSʢඪ४ϥΠϒϥϦΑΓʣ w ࠪΛݡ͘ಁաతʹѻ͏ͨΊͷ7JTJUPSʢݴޠॲཧܥΑΓʣ ΧϓηϧԽ ϙϦϞʔϑΟζϜ
࠷ޙʹ lจ໌ͷਐาɺਓ͕ҙࣝͤͣʹߦՄೳͳ ॏཁԋࢉͷత֦େʹΑΓͨΒ͞ΕΔz "MGSFE/PSUI8IJUFIFBEʢֶऀʣ
ຊࢿྉTQFBLFSEFDLʹͯެ։ࡁΈͰ͢ BETIPMPLP BETIPMPLP 5IBOLZPV