Slide 1

Slide 1 text

ʲ(PݴޠʳδΣωϦΫε Tomoki Ot a

Slide 2

Slide 2 text

ΞδΣϯμ any δΣωϦΫε 2

Slide 3

Slide 3 text

BOZ 3

Slide 4

Slide 4 text

BOZͱ͸ ۭΠϯλʔϑΣΠεJOUFSGBDF\^ͷΤΠϦΞε 4

Slide 5

Slide 5 text

BOZͱ͸ ͲΜͳܕͰ΋อ࣋Ͱ͖Δ ˠա৒ͳҰൠԽ ɹ੩తܕ෇͚ݴޠͷར఺͕ࣦΘΕΔ 5

Slide 6

Slide 6 text

BOZͱ͸ ϝιουͷγάχνϟ͸Ͱ͖Δ͚ͩ໌ࣔతʹ͢Δ BOZ͸Կͷ৘ใ΋࣋ͨͳ͍ͷͰ جຊతʹ͸࢖Θͳ͍ 6

Slide 7

Slide 7 text

BOZΛ࢖͏΂͖ͱ͖ Ϛʔγϟϧؔ਺ͳͲ͋ΒΏΔܕΛ ड͚औͬͨΓฦͨ͠Γ͢Δඞཁ͕͋Δͱ͖ 7

Slide 8

Slide 8 text

BOZΛ࢖͏΂͖ͱ͖ https://pkg.go.dev/encoding/json#Marshal encoding/jsonͷMarshal 8

Slide 9

Slide 9 text

BOZΛ࢖͏΂͖ͱ͖ database/sqlͷQueryContext https://pkg.go.dev/database/sql#DB.QueryContext SELECT * FROM FOO WHERE id = ?

Slide 10

Slide 10 text

δΣωϦΫε 10

Slide 11

Slide 11 text

δΣωϦΫεΛ࢖༻͠ͳ͍ྫ ࠨͷίʔυ͸mapܕ͔ΒΩʔΛશͯग़ྗ͢Δɻ https://go.dev/play/p/lL6T8BDRE3D 11

Slide 12

Slide 12 text

δΣωϦΫεΛ࢖༻͠ͳ͍ྫ NͷΩʔͱ஋͕ଞͷܕͰ͋ͬͨ৔߹ʹ ಈ͔ͳ͘ͳΔɻ ࠨ͸N͕NBQTUSJOHʹͳͬͨͷͰ ίϯύΠϧΤϥʔ 12

Slide 13

Slide 13 text

BOZͰ࣮૷ͨ͠ྫ HFU,FZT͸ɺBOZΛड͚ͱΓɺBOZΛฦ͢ɻ https://go.dev/play/p/9WgO0MVtYe_P 13

Slide 14

Slide 14 text

BOZͰ࣮૷ͨ͠ྫ HFU,FZT͸ɺBOZΛड͚ͱΓɺBOZΛฦ͢ɻ (Pͷ੩తܕ෇͚ͷར఺͕ࣦΘΕΔ ܁Γฦ͠ͷίʔυ͕૿͑ΔՄೳੑ ˠ%3:ݪଇʹ൓͢Δ 14

Slide 15

Slide 15 text

DPNQBSBUJWFͰ࣮૷ͨ͠ྫ ΠϯλʔϑΣΠεಉ༷BOZʹΑΔແବͳந৅Խ͸ආ͚Δ΂͖ NBQͰ͸ɺWBSNNBQ<<>CZUF>JOUͷΑ͏ʹ LFZʹεϥΠεΛऔΔ͜ͱ͸Ͱ͖ͳ͍ɻ 15

Slide 16

Slide 16 text

DPNQBSBUJWFͰ࣮૷ͨ͠ྫ 5DPNQBSBCMFͱ͸ɺ૊ΈࠐΈͷΠϯλʔϑΣΠεɻ 5DPNQBSBCMF͸΍ͰൺֱՄೳͳ஋ͷΈҾ਺ʹड͚औΔ͜ͱ͕ՄೳʹͳΔɻ 16

Slide 17

Slide 17 text

DPNQBSBUJWFͰ࣮૷ͨ͠ྫ BOZܕͷ୅ΘΓʹDPNQBSBCMFΛ༻͍Δ https://go.dev/play/p/ENyS1GKu3IU 17

Slide 18

Slide 18 text

ಠࣗͷܕ੍໿Λఆٛ͢Δ https://go.dev/play/p/VHKfcvYQNua VOJPOTΛ༻͍Δͱ ΠϯλʔϑΣΠεͰಠࣗͷܕ੍໿Λ ఆٛ͢Δ͜ͱ͕Ͱ͖Δ 18

Slide 19

Slide 19 text

VOJPOTͱ͸ ෳ਺ͷܕΛड͚औΕΔΑ͏ʹͰ͖Δ 19

Slide 20

Slide 20 text

ಠࣗͷܕ੍໿Λఆٛ͢Δ VOJPOTΛؚΉΠϯλϑΣʔε͸ܕ੍໿Ͱ͔͠࢖͑ͳ͍ɻ WBSYDVTUPN$POTUSBJOUͷΑ͏ʹ͸Ͱ͖ͳ͍ɻ

Slide 21

Slide 21 text

δΣωϦΫεͷ஫ҙ ϝιουͰ͸࢖༻Ͱ͖ͳ͍ɻ ؔ਺͸Մೳ

Slide 22

Slide 22 text

δΣωϦΫεͷ஫ҙ TUSVDUͰ͸࢖༻Ͱ͖Δɻ

Slide 23

Slide 23 text

δΣωϦΫεͷ஫ҙ ࠨ͸ɺಠࣗͷܕ੍໿ΛTUSVDUʹ࣋ͨͤͨྫ IUUQTHPEFWQMBZQ-Q/XP8P9 23

Slide 24

Slide 24 text

δΣωϦΫεͷ஫ҙ JOUFSGBDFʹTUSDVUΛFNCFEͰ͖Δ ͔͠͠ɺϑΟʔϧυʹ͸ΞΫηεͰ͖ͳ͍ɻ 24

Slide 25

Slide 25 text

δΣωϦΫεͷ஫ҙ ͜Ε΋ίϯύΠϧΤϥʔ 25

Slide 26

Slide 26 text

δΣωϦΫεͷ஫ҙ δΣωϦΫε͸͋͘·Ͱ΋ܕ੍໿ͷΈɻ ࣮ࡍʹϑΟʔϧυʹΞΫηε͢Δ͜ͱ͸Ͱ͖ͳ͍ɻ 26

Slide 27

Slide 27 text

dJOUWTJOU dJOU͸JOUΛϕʔεͱ͢ΔܕΛશͯड͚औΕΔ https://go.dev/play/p/E3kcU9-7TJ6 27

Slide 28

Slide 28 text

δΣωϦΫεΛ࢖༻͢΂͖ͱ͖ w σʔλߏ଄ FHόΠφϦπϦʔɺ࿈݁Ϧετɺώʔϓ w εϥΠεɺϚοϓɺ͓Αͼ೚ҙͷλΠϓͷνϟωϧͰಈ࡞͢Δؔ਺ w δΣωϦΫεΛ࢖ͬͯৼΔ෣͍Λந৅Խ͢Δ 28

Slide 29

Slide 29 text

εϥΠεɺϚοϓɺ͓Αͼ೚ҙͷλΠϓͷνϟωϧͰಈ࡞͢Δؔ਺ δΣωϦΫεΛ࢖༻͢΂͖ͱ͖ 29

Slide 30

Slide 30 text

δΣωϦΫεΛ࢖ͬͯৼΔ෣͍Λந৅Խ͢Δ δΣωϦΫεΛ࢖༻͢΂͖ͱ͖ 30

Slide 31

Slide 31 text

δΣωϦΫεΛ࢖༻͢΂͖Ͱ͸ͳ͍ͱ͖ w ड͚औͬͨҾ਺ͷϝιουΛ࢖༻͢Δͱ͖ w δΣωϦΫεΛ࢖͏͜ͱͰίʔυ͕ෳࡶʹͳΔͱ͖ (Pͷ։ൃऀ͸೥ؒδΣωϦΫεͳ͠Ͱ΍͖ͬͯͨ 31

Slide 32

Slide 32 text

δΣωϦΫεΛ࢖༻͢΂͖Ͱ͸ͳ͍ͱ͖ ड͚औͬͨҾ਺ͷϝιουΛ࢖༻͢Δͱ͖ͷྫ 32