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.

Graduating To Go - A Jumpstart into the Go Programming Language

213 views

Published on

This workshop jumps through a lot of what is covered in the Go Tour. The exercises are new and match more along with the class content, and some pieces (like testing and APIs) are not covered in the Go Tour.

Published in: Technology
  • Login to see the comments

Graduating To Go - A Jumpstart into the Go Programming Language

  1. 1. Graduating to Go The Go Tour and Beyond in 2.5 Hours! Kaylyn Gibilterra Software Engineer, Capital One Overly Enthusiastic About Go @kgibilterra
  2. 2. Make a friend! • Where are you from? • What do you do? • What technical experience do you have (coding or not) • Why are you interested in Go? • Do you want to be Gopher friends forever?
  3. 3. Why I love Go
  4. 4. You are already a Gopher
  5. 5. Outline 1. Installation 2. Variables & Functions 3. Loops & Conditionals 4. Structs, Arrays, Slices, & Maps 5. Methods & Interfaces 6. Concurrency 7. APIs
  6. 6. Installation https://golang.org/doc/install https://play.golang.org/ brew install go
  7. 7. Workspace
  8. 8. Testing Your Installation • Create $HOME/go/src/hello • go build • https://play.golang.org/
  9. 9. Go Syntax https://tour.golang.org
  10. 10. Variables
  11. 11. Variables
  12. 12. Variables (Imports & Exports)
  13. 13. Functions
  14. 14. Functions
  15. 15. Functions
  16. 16. Exercise • Declare 2 integers, 2 strings, and 2 booleans • One should be set to it’s zero value and one should be initialized to whatever you want • Print out those variables • Write a function that prints out all of these variables https://play.golang.org/p/aRwLHoz0Nf
  17. 17. For Loop
  18. 18. For Loop
  19. 19. While Loop
  20. 20. Infinite Loop
  21. 21. If Statements
  22. 22. If Statements
  23. 23. Exercise • Write a function that imports the library “time” to check what time it is now and print out if it falls inside the time of this conference, the WIT Experience • var day := time.Date(Year, Month, Day, Hour, Minute, Second, Nanosecond, Timezone) • var now := time.Now() • in the Play environment, time is always set to: 2009-11-10 23:00:00 +0000 UTC m=+0.000000000 • Convert this into a while loop where the program continually runs until it is WIT Experience time https://play.golang.org/p/3BPc7f9ucZ
  24. 24. Exercise
  25. 25. Exercise
  26. 26. Additional Info
  27. 27. Structs, Arrays, Slices, & Maps
  28. 28. Structs
  29. 29. Arrays
  30. 30. Slices
  31. 31. Arrays & Slices
  32. 32. Slice Range & Append
  33. 33. Maps
  34. 34. Exercise: Quicksort 1. Given an unsorted list: 2. Select a pivot number: 3. Put the pivot in the correct position for the sorted array with all smaller elements before it, and all greater elements after: 4. Recursively continue on the smaller and greater halves of the list: 3 5 2 1 6 4 3 5 2 1 6 4 3 2 1 4 6 5 3 2 1 6 54 https://play.golang.org/p/tk4si__CyW
  35. 35. https://play.golang.org/p/w6QAle3Thq
  36. 36. Methods & Interfaces
  37. 37. Methods
  38. 38. Interfaces
  39. 39. Interfaces
  40. 40. Concurrency
  41. 41. Goroutines
  42. 42. Channels
  43. 43. Channels
  44. 44. Buffered Channel
  45. 45. Write an API
  46. 46. Java •Jersey •Spring •Play Framework •RestExpress •Restlet •Spark Framework •Kotlin C/C++ •libmicrohttpd •jansson •Kore Python •Django •Tastypie •Flask •Falcon •Bottle •Eve API Frameworks
  47. 47. Hello World API https://play.golang.org/p/G08TUIjVMp
  48. 48. Go Tour - https://tour.golang.org Books • Go in Action • The Go Programming Language Online Resources • Go By Example • Effective Go • The Go Language Spec Code • github.com/golang/go • github.com/ardanlabs/gotraining Blogs / Podcasts • The Go Blog • Gopher Academy • Go Time Gopher Slack - https://invite.slack.golangbridge.org/ #ghc2017 Gopher Resources
  49. 49. Thank you! Kaylyn Gibilterra @kgibilterra
  50. 50. https://github.com/egonelbre/gophers https://github.com/ashleymcnamara/gophers https://github.com/tenntenn/gopher-stickers/tree/master/png https://github.com/shalakhin/gophericons Image Credits:

×