Slide 1

Slide 1 text

Sharif Salah Google Developer Expert 2014 Google+ profile @sharif_salah about.me/sharif.salah Learning Go

Slide 2

Slide 2 text

package main import "fmt" func main() { fmt.Println("Hello, 世界") }

Slide 3

Slide 3 text

Why Go?

Slide 4

Slide 4 text

Why Go? Expand my (and your) horizons!

Slide 5

Slide 5 text

1. Interfaces

Slide 6

Slide 6 text

type Musician struct { Name string } type Singer interface { Sing() string } func (m *Musician) Sing() string { .. }

Slide 7

Slide 7 text

2. Concurrency

Slide 8

Slide 8 text

func somefunc() { .. } func main() { go somefunc() }

Slide 9

Slide 9 text

var buffer chan string = make(chan string, 5)

Slide 10

Slide 10 text

func sender(buffer chan<- string) { for i := 0; i < 10; i++ { buffer <- "some message" fmt.Println(i) } }

Slide 11

Slide 11 text

func receiver(buffer <-chan string) { for { fmt.Println(<-buffer) } }

Slide 12

Slide 12 text

func main() { var buffer chan string = make(chan string, 5) sender(buffer) go receiver(buffer) var input string fmt.Scanln(&input) }

Slide 13

Slide 13 text

0 1 2 3 4 fatal error: all goroutines are asleep - deadlock! ..

Slide 14

Slide 14 text

func main() { var buffer chan string = make(chan string, 5) go sender(buffer) go receiver(buffer) var input string fmt.Scanln(&input) }

Slide 15

Slide 15 text

0 1 2 3 4 some message some message some message some message some message 5 ...

Slide 16

Slide 16 text

Go on Google Cloud Platform Compute Engine App Engine

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Kubernetes

Slide 19

Slide 19 text

Resources

Slide 20

Slide 20 text

Get started with Go https://tour.golang.org/ https://play.golang.org/ https://io2014codelabs.appspot.com/static/codelabs/go-codelab/#1 https://cloud.google.com/appengine/docs/go/gettingstarted/introduction

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

These slides: http://goo.gl/LbmMVi Thank you!