Upgrade to Pro — share decks privately, control downloads, hide ads and more …

1週間で終わらせるはじめてのGo言語学習/beginner-study-go

nishina
November 07, 2021

 1週間で終わらせるはじめてのGo言語学習/beginner-study-go

nishina

November 07, 2021
Tweet

More Decks by nishina

Other Decks in Programming

Transcript

  1. • ʰA Tour of Go[1] ʱͰGoݴޠͷจ๏Λͻͱ௨Γษڧ͢Δ • ʰϓϩάϥϛϯάݴޠ Go׬શೖ໳[2] ʱͰGoΛऔΓר͘؀ڥ


    ʹ͍ͭͯཧղ͢Δ • ʰαϯϓϧͰֶͿGoݴޠ[3] ʱͷؾʹͳͬͨαϯϓϧΛΈΔ • CRUD APIΛ࣮૷ͯ͠ΈΔ  1िؒͷGoݴޠֶशϩʔυϚοϓ [1]: https://go-tour-jp.appspot.com/list [2]: https://docs.google.com/presentation/d/1RVx8oeIMAWxbB7ZP2IcgZXnbZokjCmTUca-AbIpORGk/edit#slide=id.g4f417182ce_0_0 [3]: https://www.spinute.org/go-by-example/
  2. • ϦϙδτϦ • https://github.com/nishina555/echo-gorm-crud-api-example • https://github.com/nishina555/gin-gorn-crud-api-example • ٕज़ελοΫ • ϑϨʔϜϫʔΫ:

    Echoͱginͷ2ύλʔϯ • O/RϚού: GORM • ϗοτϦϩʔυ: Air • ؀ڥม਺؅ཧ: GoDotEnv • Lintπʔϧ: VS CodeͷGoϓϥάΠϯʹ͓೚ͤ  ੒Ռ෺: CRUD APIͷ࣮૷
  3. • Goݴޠ͸पลπʔϧ͕ॆ࣮͍ͯ͠Δ • ϑΥʔϚολ(goimports)ɺdocੜ੒(godoc)ɺίʔυνΣοΧʔ(go vet) • GoݴޠΛशಘ͢Δʹ͸จ๏͚ͩͰͳ͘ɺपลπʔϧͷཧղ΋ॏཁ
 • ࣅͨπʔϧ΍ݱࡏඇਪ঑ͷ৘ใ͕ࠞࡏ͍ͯ͠ΔͷͰॳݟࡴ͠ •

    ࠓ͸Go Modules͕σϑΝΫτ͕ͩɺglide, dep, govendorͷهࣄ΋ࢄݟ • ϗοτϦϩʔυ͸ਓؾͩͬͨRealizeͷ։ൃ͕ࢭ·ΓAirͷ࣌୅΁ • Lintπʔϧͷgolint͸ඇਪ঑ɺࠓ͸golangci-lint΍Staticcheck͕ओྲྀ • GoݴޠΛֶश͢Δࡍ͸ɺ৭ʑͳ৘ใΛಡΈړΔͷ͕Αͦ͞͏
 • ϑϨʔϜϫʔΫ౳ʹ͸બ୒ࢶ͕͋ΔͨΊɺٕज़બఆͷྗ͕ඞཁ • ϑϨʔϜϫʔΫͳΒBeego, gin, EchoɺORMͳΒGORM, gorp, Xorm • GoݴޠͰ࣮૷͢Δࡍ͸ɺ໨తΛ໌֬ʹ͢Δඞཁ͕͋Δ  GoݴޠΛ΍ͬͯΈͨײ૝