Togoo : Go で CLI を作って学んだこと / Gomoku #3 Togoo

Togoo : Go で CLI を作って学んだこと / Gomoku #3 Togoo

2016-02-15 に開催された「ごもく会 #3」で LT した資料です.
http://eure.connpass.com/event/25695/

詳しくはブログにまとめています.
http://kakakakakku.hatenablog.com/entry/2016/02/15/234554

3da5b00de1285b12a17d730262cc4824?s=128

Yoshiaki Yoshida

February 15, 2016
Tweet

Transcript

  1. Togoo : Go Ͱ CLI Λ࡞ͬͯ ֶΜͩ͜ͱ 2016-02-15 ͝΋͘ձ #3

  2. • @kakakakakku • Yoshiaki Yoshida • CyberAgent Crowd Funding, Inc.

    • Makuake • Ruby, DevOps, Certified Scrum Master • http://kakakakakku.hatenablog.com/ • https://github.com/kakakakakku
  3. • ࠷ۙ Go ʹೖ໳ͨ͠ʢϏΪφʔʣ • ۀ຿Ͱ͸࢖ͬͯͳ͘ݸਓͰษڧத • ͝΋͘ձ օۈ৆ʂ

  4. • A Tour of Go Λࢼͨ͠ • https://go-tour-jp.appspot.com/list • Θ͔ͬͨΑ͏ͰΘ͔ͬͯͳ͍

    • ࣮ࡍʹࣗ෼ͰԿ͔࡞ͬͯΈΑ͏ͱࢥͬͨ
  5. https://www.flickr.com/photos/kellymccarthy/7437621330 ΦϑΟεͷص͕ ෇ᝦͩΒ͚ͳ͜ͱʹؾ෇͘

  6. https://www.flickr.com/photos/kellymccarthy/7437621330 ΦϑΟεͷص͕ ෇ᝦͩΒ͚ͳ͜ͱʹؾ෇͘ • λεΫ؅ཧʹॻ͘·Ͱ΋ͳ͍ࡉ͔ͳλεΫ • ;ͱࢥ͍ग़ͨ͠λεΫ • ʮௐ΂ͱ͍ͯʂʯͱৼΒΕͨλεΫ

  7. Togoo : Simple CLI TODO Tool https://github.com/kakakakakku/togoo τ Ρ ʔ

    ΰ ʔ
  8. Togoo Usage • togoo init ( -f ) • togoo

    add • togoo update • togoo done • togoo delete • togoo list ( -a ) ʢσʔλ͸ SQLite ʹొ࿥ʣ
  9. None
  10. ֶΜͩ͜ͱͳͲ

  11. ؀ڥߏங͠Α͏ • vim & IntelliJ Ͱ։ൃ؀ڥΛ੔͑ͨ • golint = Ոఉڭࢣ

    • https://github.com/golang/lint • goimports • https://github.com/bradfitz/goimports • Travis Ͱ CI ͯ͠όοδΛషΔ
  12. ͓࡞๏ΛֶͿ • Go Code Review Comments • https://github.com/golang/go/wiki/CodeReviewComments • Effective

    Go • https://golang.org/doc/effective_go.html • Go for gophers • http://talks.golang.org/2014/go4gophers.slide#1
  13. ύοέʔδΛֶͿ • cli.go : https://github.com/codegangsta/cli • gcli : https://github.com/tcnksm/gcli •

    go-sqlite3 : https://github.com/mattn/go-sqlite3 • go-homedir : https://github.com/mitchellh/go-homedir • Table Writer : https://github.com/olekukonko/tablewriter table := tablewriter.NewWriter(os.Stdout) table.SetHeader([]string{"No", "Title", "Status"}) table.SetBorder(true) table.AppendBulk(data) table.Render()
  14. gcli new -c add -c list mytodo ←ࣗಈͰ਽ܗΛ࡞ͬͯ͘Εͯ ←go build

    ͢Δͱ ←͙͢ಈ͘ ίϚϯυఆٛ CLI ໊
  15. “Good CLI” Λ࡞ΔͳΒඞಡ https://speakerdeck.com/tcnksm/komandorainturunituiteyu-rutokinipu- falseyu-rukoto-number-yapcasia “1ͭͷ͜ͱʹूத͍ͯ͠Δ” “௚ײతʹ࢖͑Δ” ͳͲ…

  16. ϙϞυʔϩςΫχοΫ࿈ܞ ࣗݾྲྀϙϞυʔϩΛ࣮ફ͍ͯ͠Δ࿩ - kakakakakku blog http://kakakakakku.hatenablog.com/entry/2016/01/30/233353

  17. • ϙϞυʔϩςΫχοΫ࿈ܞͰ1೔த࢖͏ • ຖேλεΫΛચ͍ग़͢ • togoo add … • togoo

    add … • togoo add … • ϙϞυʔϩ͝ͱʹλεΫΛ׬ྃ͢Δ • togoo done … • togoo done … • togoo done …
  18. • ࣗݾྲྀϙϞυʔϩ • ۀ຿֎ͷ OSS ׆ಈͳͲ΋ togoo add ͢Δ •

    ࡶ຿΋શͯ togoo add ͢Δ • ͋͑ͯίϯςΩετεΠονΛى͜͢ • ʮऩ֭చݮͷ๏ଇʯ
  19. ·ͱΊ

  20. • Go ϏΪφʔͰ΋ CLI Λ࡞ΕΔʂʂʂ • υοάϑʔσΟϯά͢Δॏཁ͞ • OSS Ͱެ։͢ΔͱϓϧϦΫΛ΋Β͑ͨΓ͢Δ

    • ײಈ...ʂ