Slide 1

Slide 1 text

mercari.go #7 @nsega Introduction my way to learn Go for beginners

Slide 2

Slide 2 text

About Me ● Naoki Sega (Twitter/GitHub: @nsega ) ● Backend Team in Mercari JP / Category growth ● Joined Mercari JP in November 2018. ● Go : About six months experience in coding as the Production Code. ● Community : Kubernetes Meetup, Cloud Native Meetup, … etc ● My current interests: Go, GCP, Kubernetes, Microservices, CNCF Products.

Slide 3

Slide 3 text

Agenda

Slide 4

Slide 4 text

Agenda ● My background ● My approach to learn Go ● Tips ● Conclusion

Slide 5

Slide 5 text

My background

Slide 6

Slide 6 text

My background ● Java (Spring, Spring MVC, Spring Boot, ..etc) ● Experience developing and operating in large-scale service ● Experience with AWS, Sakura(cloud services) and on-premises ● More than 10 years experience in Backend/Infra Engineer

Slide 7

Slide 7 text

My approach to learn Go

Slide 8

Slide 8 text

INPUT OUTPUT PROCESS My Learning Flow - Overview Phase 1 Getting Started Phase 2 More practical Phase 3 Practice,..and practice through Issues, PRs Community, Social Media Code Code, Doc Code, Doc Code, Doc

Slide 9

Slide 9 text

INPUT Phase 1 : Getting started ● The Go Programming Language ○ Documentation ○ A Tour of Go ○ The Go Programming Language Specification ○ Packages My approach to learn Go (1/4)

Slide 10

Slide 10 text

INPUT Phase 2 : More practical ● Effective Go ● CodeReviewComments ● Goに入ってはGoに従え ● Go at Google: Language Design in the Service of Software Engineering ● Go for Java Programmers My approach to learn Go (2/4)

Slide 11

Slide 11 text

My approach to learn Go (3/4) INPUT Phase 3: practice, practice and practice ● Practical Go: Real world advice for writing maintainable Go programs ● Looking for Issues/PRs and Reading Code ○ in the production code. ○ in OSS ( Kubernetes, Docker, ...etc) ● Attending a study session (e.g. In my case, GoFriday)

Slide 12

Slide 12 text

INPUT Optional (To catch up on latest information timely) ● The Go Blog ● Community ○ The Go Project ○ Gophers (gophers.slack.com) FYI: to join gophers.slack.com ○ golang.tokyo  , Go Conference , .. and so on in Japan. ● reddit - r/golang ● Twitter Golang Weekly(@golangweekly), Go News(@golangnews), Go Time(@GoTimeFM) My approach to learn Go (4/4)

Slide 13

Slide 13 text

INPUT OUTPUT PROCESS My Learning Flow - Overview Phase 1 Getting Started Phase 2 More practical Phase 3 practice,..and practice through Issues, PRs Community, Social Media Code Code, Doc Code, Doc Code, Doc

Slide 14

Slide 14 text

Tips

Slide 15

Slide 15 text

Tips 1 : Use the go tool Go tool ● Many useful tools prepared in cmd package. ● e.g. go vet, go generate, go build, ...etc ● I frequently used go tool :) https://golang.org/cmd/go/ https://godoc.org/golang.org/x/tools https://godoc.org/golang.org/x/tools/cmd

Slide 16

Slide 16 text

Tips 2 : Use the Lint tools: reviewdog https://github.com/reviewdog/reviewdog https://link.medium.com/n9WDCXP3lV

Slide 17

Slide 17 text

Tips 2 : Use the Lint tools: reviewdog ● govet golang.org/cmd/vet/ ● golint github.com/golang/lint ● misspell github.com/client9/misspell ● errcheck github.com/kisielk/errcheck ● staticcheck staticcheck.io/docs/staticcheck https://github.com/reviewdog/reviewdog

Slide 18

Slide 18 text

Tips 3 : Use IDE and editor support plugin ● gofmt ● goimports ● Lookup Godoc ● Code completion/Code navigation ● Debugger FYI: My recommendation: GoLand “GoLand is an IDE by JetBrains aimed at providing an ergonomic environment for Go development.” - Nilness Analyzer ( from GoLand 2019.1 in Beta) “a set of code inspections designed to instantly detect whether variables might have nil or not nil values in a variety of cases.” https://blog.jetbrains.com/go/2019/03/14/goland-2019-1-goes-beta/

Slide 19

Slide 19 text

The Go Playground play.golang.org ● You can build and run the programs easily on the Go Playground. ● e.g. Data Structures(Arrays, Slices, Maps), Concurrency Tips 4 : Use the Go Playground

Slide 20

Slide 20 text

Conclusion

Slide 21

Slide 21 text

Conclusion ● Implementing INPUT => PROCESS => OUTPUT cycle repeatedly. ● Reflecting my output and others feedback constantly. ● Designing simply, Coding simply. ● Contributing to OSS, community. ● Practice, practice, and practice.

Slide 22

Slide 22 text

Any Questions??