Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Initial pass.

  • Loading branch information...
commit 538d8e5d320c878ed313488bfb713c560bcd3e49 1 parent c6375e7
@cespare authored
View
29 concurrency.go
@@ -0,0 +1,29 @@
+package main
+
+import (
+ "fmt"
+ "math/rand"
+ "time"
+)
+
+// START OMIT
+func Query(boring string) string {
+ time.Sleep(time.Duration(rand.Intn(10)) * time.Second)
+ return boring + "!!!"
+}
+
+func main() {
+ start := time.Now()
+ defer func() { fmt.Printf("Got result in %.3f seconds\n", time.Since(start).Seconds()) }()
+ rand.Seed(time.Now().UnixNano())
+ c := make(chan string)
+ for i := 0; i < 10; i++ {
+ go func() { c <- Query("hello") }()
+ }
+ select {
+ case result := <-c:
+ fmt.Println("Result:", result)
+ return
+ }
+}
+// END OMIT
View
24 hello_net.go
@@ -0,0 +1,24 @@
+package main
+
+import (
+ "fmt"
+ "net"
+ "log"
+)
+
+func main() {
+ server, err := net.Listen("tcp", ":6543")
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Println("Now listening on port 6543...")
+ for {
+ conn, err := server.Accept()
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Fprintf(conn, "Hello, %s!\n", conn.RemoteAddr())
+ fmt.Printf("Said hello to %s!\n", conn.RemoteAddr())
+ conn.Close()
+ }
+}
View
BIN  images/appenginegopher.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/appenginegophercolor.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/appenginelogo.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/bumper.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/bumper192x108.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/bumper320x180.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/bumper480x270.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/bumper640x360.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/doc.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/frontpage.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/gopherbw.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/gopherbw_small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/gophercolor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/gophercolor16x16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/help.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/pkg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/project.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/ref.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/run.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  images/talks.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
166 oo-go.slide
@@ -5,6 +5,168 @@ Caleb Spare
Ooyala
caleb@ooyala.com
-* Foo
-Baz
+
+* This talk will not teach you Go
+
+But I hope you're interested to learn more afterwards.
+
+This talk will include:
+
+- A brief intro to the language and tools
+- Code
+- Demos
+- Gophers
+
+
+
+
+* Overview
+
+
+
+* A brief history
+
+- Developed at Google starting in 2007.
+- Open-sourced in 2009.
+- Original creators: Robert Griesemer, Rob Pike, and Ken Thompson.
+- Go now has many contributors both inside and outside of Google.
+- March 2012: Go 1 released.
+
+.image images/gopherbw_small.png
+
+
+
+
+* The language
+
+- Statically typed, with type inference
+- Generates fast native code
+- Compiles _really_ quickly
+- Simple and fun
+- Has pointers (but none of the dangerous stuff)
+- Concurrent
+- Garbage-collected
+
+
+
+
+* Go is opinionated
+
+- Public/private is determined by initial upper-case letters
+- Error handling
+- No classes/inheritence
+- Aggressive focus on language simplicity and orthogonality of features
+- Built to help software engineers, not advance PL research
+
+
+
+
+* Go on everything
+
+Go has a spec, and two separate compilers that implement it.
+
+gc:
+
+- The original Go compiler
+- So fast
+- (x86, x64, ARM) × (Linux, OS X, Windows, FreeBSD, OpenBSD, NetBSD, Plan 9)
+
+gccgo:
+
+- A GCC frontend for Go
+- Included in GCC 4.7.1 (released in June)
+- Sometimes generates more optimized code
+- Supports additional architectures (PPC, MIPS, SPARC, ...) and OSes (Solaris, IRIX, ...)
+
+
+
+* Dat tooling
+
+- go
+- go get
+- gofmt
+- gofmt -r
+- go test
+- gofix
+- go vet
+- godoc
+- gdb
+- profiling
+
+
+* Code Examples
+
+
+
+* Our hello world is a server
+
+.play hello_net.go
+
+
+
+* Concurrency
+
+.play concurrency.go /START OMIT/,/END OMIT/
+
+
+
+* Demos
+
+
+* Building go code
+
+Build and run:
+
+ go run mycode.go
+
+Just build an executable:
+
+ go build mycode.go
+
+Oh, your server is a different platform?
+
+ GOARCH=amd64 GOOS=linux go build
+
+
+
+* Your deploy script
+
+ #!/bin/bash
+
+ scp myserver root@prod-server1.us-east-1.ooyala.com:/opt/awesome_server/
+
+
+
+* Go in the industry
+
+- Google (golang.org, youtube, dl.google.com, ...)
+- Canonical
+- Heroku
+- SoundCloud
+- Stathat
+- Bitly
+- Nokia
+- BBC Worldwide
+- ...
+
+
+
+* ...Ooyala?
+
+- Docs: yard-doc.ooyala.com
+- hastur-go
+- go-ooyala-headers
+- Go is already in production! (almost)
+
+
+
+* Get started!
+
+.link http://tour.golang.org/ Go Tour
+.link http://golang.org/doc/effective_go.html Effective Go
+.link https://gobyexample.com/ Go by Example
+.link http://golang.org/doc/codewalk/ Code Walks
+.link http://golang.org/pkg/ Stdlib docs
+.link http://go.pkgdoc.org GoPkgDoc
+.link http://play.golang.org/ Go Playground
Please sign in to comment.
Something went wrong with that request. Please try again.