Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Learning Go

sharifsalah
November 16, 2014

Learning Go

A lightning talk on my personal experience of starting to learn Go from the GDG Silicon Valley DevFest for 2014 held at Google.

sharifsalah

November 16, 2014
Tweet

More Decks by sharifsalah

Other Decks in Programming

Transcript

  1. type Musician struct { Name string } type Singer interface

    { Sing() string } func (m *Musician) Sing() string { .. }
  2. func sender(buffer chan<- string) { for i := 0; i

    < 10; i++ { buffer <- "some message" fmt.Println(i) } }
  3. func main() { var buffer chan string = make(chan string,

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

    5) go sender(buffer) go receiver(buffer) var input string fmt.Scanln(&input) }
  5. 0 1 2 3 4 some message some message some

    message some message some message 5 ...