Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Go Workshop Day 0

306 views

Published on

Go Workshop Day 0

Published in: Engineering
  • Be the first to comment

Go Workshop Day 0

  1. 1. Go Workshop Day 0 2016/07/26
  2. 2. Go Workshop 3 ( ) 1 0 ( ) 1 + 2 Web
  3. 3. • Go • Web • Go •
  4. 4. • Go • • •
  5. 5. Go 2009/11/10 ... 2012/03/28 Go1 ... 2015/08/19 Go1.5 2016/02/17 Go1.6 2016/07? Go1.7
  6. 6. Go 1 simple & easy Go • • • •
  7. 7. Go 2 • import •
  8. 8. Go 3 1 1 1 Mac Win Linux 1
  9. 9. Go • • (Docker, rkt) • Worker Queue(NSQ) • (rtop) • CMS(Hugo)
  10. 10. Go • Web API, Web • • HTML JSON XML API • Go •
  11. 11. Go • CLI ( , ) • 1 • •
  12. 12. Go • OS • GC OS •
  13. 13. Go • • GC • 1MB • Raspberry Pi
  14. 14. Go • • Go DSL • • generics
  15. 15. Go • Docker • Go (1.5 Go Go ) • Origami • Web
  16. 16. the Go Way Go
  17. 17. • • GOPATH •
  18. 18. • ( Windows ) • https://golang.org/dl/ • homebrew (Mac) • brew install go • apt, yum (Linux) • • ( )
  19. 19. Web 1.6 2 1.7
  20. 20. GOPATH GOPATH Go Go $GOPATH/src
  21. 21. GOPATH Q. A. $HOME(win %HOME%) GOPATH=$HOME/go GOPATH=$HOME
  22. 22. IDE Editor IDE
  23. 23. IDE ( ) • Atom • Visual Studio Code ( ) • IntelliJ • Vim
  24. 24. IDE gofmt gofmt lint
  25. 25. • Go • GOPATH
  26. 26. mkdir $GOPATH/src/hello mkdir $GOPATH/src/hello/greeting cd $GOPATH/src/hello
  27. 27. greeting/greeting.go $GOPATH/src/hello/greeting/greeting.go package greeting import "fmt" func Hello(name string) string { return fmt.Sprintf("Hello, %s!", name) }
  28. 28. main.go $GOPATH/src/hello/main.go package main import ( "fmt" "net/http" "hello/greeting" ) func main(){ http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, greeting.Hello("Gopher")) }) http.ListenAndServe(":8080", nil) }
  29. 29. Go 1.7
  30. 30. • ( ) • • test

×