Slide 1

Slide 1 text

1 (PͷΤϥʔελοΫτϨʔεͷྺ࢙ͱࠓޙ (PͷΤϥʔϋϯυϦϯά࠷৽ࣄ৘-VODI-5 !TPOBUBSEͦͳଠגࣜձࣾ4UBDL

Slide 2

Slide 2 text

2 (PͷΤϥʔτϨʔεͷྺ࢙ w IUUQTHJUIVCDPNQLHFSSPSTϦϦʔε w ελοΫτϨʔεʹରԠ w FSSPSXSBQͷελϯμʔυʹͳΔ func main() { if err := errorsA1(); err != nil { fmt.Printf("main: %+v", errors.Cause(err)) } } func errorsA1() error { err := errors.New("not found") return errors.Wrap(err, "errorsA1") }

Slide 3

Slide 3 text

3 (PͷΤϥʔτϨʔεͷྺ࢙ w (PνʔϜ͔ΒطଘͷFSSPSʹ͍ͭͯͷ໰୊ఏى w IUUQTHPHPPHMFTPVSDFDPNQSPQPTBMNBTUFSEFTJHOHPESBGUFSSPS JOTQFDUJPONE w IUUQTHJUIVCDPNHPMBOHHPJTTVFT w IUUQTHJUIVCDPNHPMBOHHPJTTVFT

Slide 4

Slide 4 text

4 (PͷΤϥʔτϨʔεͷྺ࢙ w 1SPQPTBMͰFSSPSͷXSBQͷఏҊͱ࣮ݧ༻ͷYFSSPST͕ϦϦʔε w IUUQTQLHHPEFWHPMBOHPSHYYFSSPST w XͰΤϥʔΛϥοϓ w ΤϥʔτϨʔεʹରԠ func main() { if err := xerrorsA1(); err != nil { fmt.Printf("main: %+v", err) } } func xerrorsA1() error { err := xerrors.New("not found") return xerrors.Errorf(": %w", err) }

Slide 5

Slide 5 text

5 (PͷΤϥʔτϨʔεͷྺ࢙ w (PͷFSSPSTͰਖ਼ࣜʹXSBQʹରԠ w GNU&SSPSGͱXͰϥοϓ͢Δ YFSSPST͸FSSPST&SSPSGͱXͩͬͨ w ͔͠͠ελοΫτϨʔεग़ྗ͸࠾༻͞Εͳ͔ͬͨ w IUUQTHJUIVCDPNHPMBOHHPJTTVFTJTTVFDPNNFOU w NFUIBOFϒϩά(PͷFSSPS͕ελοΫτϨʔεΛؚ·ͳ͍ཧ༝ w YFSSPSTͰ͸ɺελοΫτϨʔεग़ྗ͸ܧଓ func main() { if err := errorsA1(); err != nil { fmt.Printf("main: %+v", err) } } func errorsA1() error { err := errors.New("not found") return fmt.Errorf("invalid argument %w", err) }

Slide 6

Slide 6 text

6 (PͷΤϥʔτϨʔεͷྺ࢙ w QLHFSSPSTͷ(JU)VCϦϙδτϦ͕ΞʔΧΠϒ͞ΕΔ w Ҡߦઌͷఆ൪͕ݟ͔ͭΒͳ͍ঢ়ଶ͕࢝·Δ w ʹYFSSPTͷ&SSPSGɺ6OXSBQɺ"Tɺ*Tɺ͕EFQSFDBUFE w YFSSPSTͷ6OXSBQɺ"Tɺ*T͸(PͷFSSPSTQBDLBHFͰ୅ସͰ͖ΔͨΊෆཁʹͳͬͨ w FSSPSTQBDLBHFͷ&SSPSG͸τϨʔεػೳ͕ͳ͍ͨΊɺYFSSPSTͷ&SSPSGΛ୅ସͰ͖ͳ͍ ͨΊYFSPSSTͷҠߦ͕ഭΒΕΔঢ়گʹͳΔ w ʹYFSSPST&SSPSG͸EFQSFDBUFEղআ w /FXͱ&SSPSG͕ར༻Ͱ͖ΔͷͰɺYFSSPST͕ར༻Ͱ͖Δঢ়ଶʹͳͬͨ

Slide 7

Slide 7 text

7 (PͷΤϥʔτϨʔεͷྺ࢙ w (PͰFSSPST+PJOͱGNU&SSPSGͷෳ਺Τϥʔͷ8SBQαϙʔτ w YFSSPST&SSPSG͸ෳ਺ΤϥʔͷϥοϓΛαϙʔτ͍ͯ͠ͳ͍ͷͰɺඪ४ϥΠϒϥϦͱͷ ػೳ͕ࠩੜ·Εͯ͠·ͬͨ w FSSPST+PJO͸YFSSPSTͰ΋࢖͑Δ w ΤϥʔτϨʔε్͕੾ΕΔ໰୊͕͋Δ func main() { if err := errorsA1(); err != nil { fmt.Printf("main: %+v", err) } } func errorsA1() error { err := errors.New("not found") return fmt.Errorf("1: %w, 2: %w", err, err) } func errorsA1() error { err := errors.New("not found") return errors.Join(err, errors.New("invalid argument")) }

Slide 8

Slide 8 text

8 (PͷΤϥʔτϨʔεͷࠓޙ w (0%(FSSTUBDLUSBDFؚ͕·Ε͍ͯΔͱ͖ʹFSSPSʹελοΫτϨʔ εΛؚΉఏҊ w IUUQTHJUIVCDPNHPMBOHHPJTTVFT w (P4VSWFZ w (Pͷ՝୊ͰτοϓλΠ 11% 11% 7% 6% 6% 8% The type system Tooling Missing or immature libraries / frameworks Differences from more familiar languages / ecosystems Error handling / stack traces Learning curve / best practices / docs (open-ended text response) What, if anything, is the biggest challenge you personally face using Go today?

Slide 9

Slide 9 text

9 (PͷΤϥʔτϨʔεͷࠓޙ w ࠓޙͲ͏ͳΔͷ͔ʁ w 4VSWFZͰ্ҐͳͷͰɺରԠ͞ΕΔ͜ͱΛظ଴͍ͨ͠ w ରԠ͢Δ·ͰͲ͏͢Ε͹͍͍ͷ͔ʁ w QLHFSSPST΍YFSSPSTͷ··଱͑Δ w ۃྗӈԟࠨԟ͠ͳ͍ w ϓϩμΫτͰ໰୊͕ى͖͍ͯͳ͍ͳΒɺযͬͯҠߦ͠ͳ͍ w (PνʔϜΛظ଴ͯ͠଴ͭ w ଞͷύοέʔδΛ࠾༻͢Δ w ໨త͕͋Ε͹ద੾ʹଞͷύοέʔδΛ࠾༻͢Δ w ʮνʔϜͱͯ͠ΞʔΧΠϒ͞ΕͨQBDLBHF͸ར༻͠ͳ͍ϧʔϧͳͷͰɺQLH FSSPST͔ΒͷҠߦઌΛ୳͢ʯ w ʮෳ਺ͷΤϥʔϥοϓΛ࢖͍͍ͨͷͰɺYFSSPST͔ΒͷҠߦઌΛ୳͢ʯ w ʮϥΠϒϥϦ"ͷ#ػೳΛ࢖͏͔ΒҠߦ͢Δʯ

Slide 10

Slide 10 text

10 (PͷΤϥʔτϨʔεͷࠓޙ w ଞͷύοέʔδΛ࠾༻͢Δ w IUUQTHJUIVCDPNDPDLSPBDIECFSSPST w ϦονͳػೳΛ࢖͍͍ͨ w ΤϥʔҎ֎ͷ෇Ճ৘ใΛ؅ཧ͍ͨ͠ͳͲ w IUUQTHJUIVCDPNHPFSSPSTFSSPST w YFSSPST͸࢖͍ͨ͘ͳ͍͕ɺඪ४ϥΠϒϥϦͷFSSPSTͱ͍ۙΠϯλʔϑΣʔεʹͨ͠ ͍ɺFSSPST+PJOͰΤϥʔτϨʔεʹ໰୊͕͋Δ w IUUQTDTPQFOTPVSDFHPPHMFHPYQLHTJUFNBTUFSJOUFSOBMEFSSPSTEFSSPSTHP PSIUUQTHJUIVCDPNFBSUICPVOELJEFSSPSY w EFGFSͰΤϥʔͷϥοϓΛ͍ͨ͠ w EFSSPST΍FSSPSY͸γϯϓϧͳϥΠϒϥϦͳͷͰɺࢀߟʹಠࣗͰ࣮૷͢Δͷ΋͓͢͢ Ί

Slide 11

Slide 11 text

11 (PͷΤϥʔτϨʔεͷࠓޙ w QLHFSSPST func main() { if err := errorsA1(); err != nil { fmt.Printf("main: %+v", errors.Cause(err)) } } func errorsA1() error { err := errors.New("not found") return errors.Wrap(err, "errorsA1") }

Slide 12

Slide 12 text

12 (PͷΤϥʔτϨʔεͷࠓޙ w YFSSPST func main() { if err := xerrorsA1(); err != nil { fmt.Printf("main: %+v", err) } } func xerrorsA1() error { err := xerrors.New("not found") return xerrors.Errorf(": %w", err) }

Slide 13

Slide 13 text

13 (PͷΤϥʔτϨʔεͷࠓޙ w DPDLSPBDIECFSSPST func main() { if err := errorsA1(); err != nil { fmt.Printf("main: %+v", err) } } func errorsA1() error { err := errors.New("not found") return errors.Wrap(err, "errorsA1") }

Slide 14

Slide 14 text

14 (PͷΤϥʔτϨʔεͷࠓޙ w HPFSSPST func main() { if err := goerrorsA1(); err != nil { fmt.Printf("main: %v", err.(*errors.Error).ErrorStack()) } } func goerrorsA1() error { err := errors.New("not found") return errors.Wrap(err, 1) }

Slide 15

Slide 15 text

15 (PͷΤϥʔτϨʔεͷࠓޙ w EFSSPST func main() { if err := derrorsA1(); err != nil { var se *derrors.StackError errors.As(err, &se) fmt.Printf("main: %s", se.Stack) } } func derrorsA1() (err error) { defer derrors.WrapStack(&err, "error in A1") return errors.New("not found") }

Slide 16

Slide 16 text

16 (PͷΤϥʔτϨʔεͷࠓޙ w FSSPSY func main() { if err := errorxA1(); err != nil { fmt.Printf("main: %v", err) } } func errorxA1() (err error) { defer errorx.Trace(&err) return errors.New("not found") }