A quick look at Go and what makes it special.
Icons: @iconmonstr Photos: http://peterhellberg.vsco.co/
Introduction toThe Go ProgrammingLanguage
View Slide
@peterhellberg
September21, 2007
March28, 20
Go 1
What is Go?
Go is about composition,concurrency, and gophers.!Keep that in mind.
Composition
Go is Object Oriented,but: - NO classes- NO subtype inheritance- Interfaces aresatisfied implicitly
A statically-typedlanguage with syntaxloosely derived fromthat ofC
Concise variabledeclaration andinitialization throughtype inference(x := 0 not int x = 0)
Built-in concurrencyprimitives: - goroutines- channels- select
CSPhttp://en.wikipedia.org/wiki/Communicating_sequential_processes
A fully garbagecollectedlanguage With completecontrol overmemory layout.
CompilationCross c
Native machinecode (32-bit and64-bit x86, ARM)
‘Batteries included’standard library
netarchivedatabasecryptoencodingunicodecompress
Hello World!
package main!import “fmt"!func main() {fmt.Println(“Hello World!”)}
Hello World!delivered over HTTP
package main!import (“fmt"“net/http")!func main() {http.HandleFunc(“/",func(w http.ResponseWriter, r *http.Request) {fmt.Fprintln(w, “Hello", r.URL.Path[1:])})!http.ListenAndServe(“:8080", nil)}
curl http://:8080/World!go run hello_server.go
255075100Oct 09 Oct 10 Oct 11 Oct 12 Oct 13PopularityNumbers represent search interest relative to the highest point on the chart.
– gobyexample.comcAB Reading material BDa– learnxinyminutes.com/docs/go– golang.org/doc