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.
Introduction to Go
AND WHY IT’S AWESOME
About me
SWE at Google
Open source
Kubernetes written in Go
https://github.com/kubernetes/kubernetes
Today you’ll learn
What is Go?
Why Go?
Basic Syntax
Features
A little background
about Go...
History
Started at Google
Released, open-sourced in 2009
New, modern
20161945
C
1972
Python
1991
Java
JavaScript
1995
Go
2...
Why Go?
Google internal needs
★ Efficient large scale programming
★ Distributed systems
★ Speed of compilation
★ Multicore...
Go is…
Fast compilation time
Concurrent
Garbage-collected
Modern with support for networked and
multi-core computing
Gener...
Design Principles
Simplicity concepts easy to understand
Orthogonality concepts mix cleanly
Readability comprehensible wit...
Companies Using Go
http://stackshare.io/go/in-stacks
Some basic syntax
Hello World
Functions
Object-oriented?
Yes and no...
Composition over inheritance
★ No type hierarchy
★ No class
★ No generics
Simple Type System
Statically typed, with type inference
Types and methods
You can define methods on any type I mean ANY
Interfaces
An interface type defines a set of methods
More on Go features
Concurrency
UNIX: processes connected by pipes
$ find ~/go/src/pkg | grep _test.go$ | xargs wc -l
Go: goroutines connected...
Concurrency: goroutines
Lightweight threads
Concurrency: channels
Channels are a typed pipe for
★ Synchronization
★ Communication
Concurrency philosophy
The efficiency of an asynchronous model written in a synchronous style
Connect goroutines with chan...
Tooling
gofmt reformats code
goimports updates import lines
golint prints style mistakes
godoc documentation of packages a...
Rich library support
Comprehensive standard library
150+ packages
Many great external libraries
120, 000+ packages
https:/...
What’s Go good for?
Go: a general-purpose language
Not just a “systems language”
Unexpected interest from users of scripting languages
Diverse...
Demo:
a simple web app
Recap: Go is
Fast compilation time
Concurrent
Garbage-collected
Modern with support for networked and
multi-core computing...
What’s next
A Tour of Go tour.golang.org
The Go Playground play.golang.org
Documentation golang.org/doc
Go Wiki github.com...
Upcoming SlideShare
Loading in …5
×

Introduction to go, and why it's awesome

https://golang.org/
* golang tutorial - https://tour.golang.org/
* golang playground - https://play.golang.org/
* Go GitHub repo https://github.com/golang/go
* Kubernetes GitHub repo https://github.com/kubernetes/kubernetes
* Demo a simple web server - https://gist.github.com/janetkuo/063d667861a67a05ae4ea8779c501036

  • Login to see the comments

Introduction to go, and why it's awesome

  1. 1. Introduction to Go AND WHY IT’S AWESOME
  2. 2. About me SWE at Google Open source Kubernetes written in Go https://github.com/kubernetes/kubernetes
  3. 3. Today you’ll learn What is Go? Why Go? Basic Syntax Features
  4. 4. A little background about Go...
  5. 5. History Started at Google Released, open-sourced in 2009 New, modern 20161945 C 1972 Python 1991 Java JavaScript 1995 Go 2009 https://golang.org/
  6. 6. Why Go? Google internal needs ★ Efficient large scale programming ★ Distributed systems ★ Speed of compilation ★ Multicore, networked hardware http://xkcd.com/
  7. 7. Go is… Fast compilation time Concurrent Garbage-collected Modern with support for networked and multi-core computing General-purpose Compiled Statically typed like C, Java Feels as easy, lightweight as JS, Python
  8. 8. Design Principles Simplicity concepts easy to understand Orthogonality concepts mix cleanly Readability comprehensible with little context
  9. 9. Companies Using Go http://stackshare.io/go/in-stacks
  10. 10. Some basic syntax
  11. 11. Hello World
  12. 12. Functions
  13. 13. Object-oriented?
  14. 14. Yes and no... Composition over inheritance ★ No type hierarchy ★ No class ★ No generics
  15. 15. Simple Type System Statically typed, with type inference
  16. 16. Types and methods You can define methods on any type I mean ANY
  17. 17. Interfaces An interface type defines a set of methods
  18. 18. More on Go features
  19. 19. Concurrency UNIX: processes connected by pipes $ find ~/go/src/pkg | grep _test.go$ | xargs wc -l Go: goroutines connected by channels, concurrency made easy to use
  20. 20. Concurrency: goroutines Lightweight threads
  21. 21. Concurrency: channels Channels are a typed pipe for ★ Synchronization ★ Communication
  22. 22. Concurrency philosophy The efficiency of an asynchronous model written in a synchronous style Connect goroutines with channels -- simpler, maintainable code
  23. 23. Tooling gofmt reformats code goimports updates import lines golint prints style mistakes godoc documentation of packages and symbols go vet vets the package go get download and install packages and dependencies go test automates testing the packages no more tabs vs. spaces! no more “import not used”, or “import not found”
  24. 24. Rich library support Comprehensive standard library 150+ packages Many great external libraries 120, 000+ packages https://godoc.org/
  25. 25. What’s Go good for?
  26. 26. Go: a general-purpose language Not just a “systems language” Unexpected interest from users of scripting languages Diverse uses across the community ★ Scientific computing ★ Web applications ★ Graphics and sound ★ Network tools ★ … and much more
  27. 27. Demo: a simple web app
  28. 28. Recap: Go is Fast compilation time Concurrent Garbage-collected Modern with support for networked and multi-core computing General-purpose Compiled Statically typed like C, Java Feels as easy, lightweight as JS, Python
  29. 29. What’s next A Tour of Go tour.golang.org The Go Playground play.golang.org Documentation golang.org/doc Go Wiki github.com/golang/go/wiki https://golang.org/

×