7 languages in 7 months, 2019-09-18 einführung in go eine (nicht … · eine (nicht ganz...
TRANSCRIPT
![Page 1: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/1.jpg)
Eine (nicht ganz objektive) Einführung in Go
7 languages in 7 months, 2019-09-18
Sebastian Sprenger
Software Engineer
@sebsprenger
![Page 2: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/2.jpg)
Arbeitet bei Breuninger an breuninger.com
Clean Code und Architektur
Generalist mit Sprach- kenntnissen in C/C++, Java, JavaScript, Python und Go
SEBASTIAN SPRENGER
![Page 3: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/3.jpg)
Meine Ziele
● Überblick wieso Go ist wie es ist● Vorstellung von ausgewählten Sprachfeatures● Concurrency demonstrieren
Euch Bock machen auf Go
Ich könnte ewig reden, aber versuche mich auf diese Ziele zu fokussieren.
● Code Beispiele● Vorstellung des Ökosystems● Weiterführende Informationen
Euch enablen Go auszuprobieren
![Page 4: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/4.jpg)
Today’s (glorious) blather.
Sprachen 01
go’s opinions
Code
Ökosystem
Zusammenfassung
Ausblick
02
03
04
05
06
![Page 5: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/5.jpg)
SPRACHEN
JavaScriptC/C++Java
![Page 6: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/6.jpg)
{Sprachen
JavaScriptC/C++
Java
Compiled? Interpreted? Bytecode?Rigid types? Dynamic types?Object/field/method Visibility?Malloc/free? Garbage Collection?Pointers? References?(Checked) Exceptions? Return Codes?Concurrency? Functions?
![Page 7: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/7.jpg)
~ Pretty much everyone
Brauchen wir wirklich noch eine Sprache?
![Page 8: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/8.jpg)
TIOBE Index
● Populäre Sprachen sind recht alt
![Page 9: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/9.jpg)
Historie
1975 1980 1985 1990 1995 2000 2005 2010 2015
1972 C1985 C++
1986 Erlang
1990 Python
1995 Java1995 JavaScript1995 Ruby1995 PHP
2003 Groovy
2004 Scala
2009 Go
2010 Rust
2011 Elixir2011 Kotlin
2014 Swift2000 C#
![Page 10: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/10.jpg)
Wunschliste bei Google
● Einfach zu programmieren wie eine interpretierte, dynamische Sprache
● Effizient und sicher wie eine statisch typisierte und kompilierte Sprache
● Modern, mit Support für Netzwerke und Multi Core Computing
● Schnell: Es soll höchstens wenige Sekunden dauern, um ein großes Executable auf einem einzelnen Computer zu bauen
![Page 11: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/11.jpg)
{Warum noch eine Sprache?
Eine neue Sprache
● Ein ausdrucksstarkes, aber leichtgewichtiges Typsystem
● Concurrency● Garbage Collection● etc
![Page 12: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/12.jpg)
go’s opinionsEine Sprache mit Attitüde
![Page 13: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/13.jpg)
go’s opinions
HotSpotChrome V8
Robert Griesemer Rob Pike Ken ThompsonUNIX, Plan 9
UTF-8UNIX
sh, ed, B, C
![Page 14: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/14.jpg)
go’s opinions
● Einstimmiger Konsens○ Ein Feature findet seinen Weg nur dann in die Sprache,
wenn alle drei denken, dass es eine gute Idee ist○ Go ist nicht “feature bloated”
● Go möchte eine Sprache für die reale Welt sein● Andere Sprachen konvergieren, Go nicht
○ Java kann Functions○ JavaScript hat Klassen
![Page 15: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/15.jpg)
go’s opinions
● Leichtgewichtige Syntax, starkes Typsystem● Garbage collected● Kompiliert so schnell wie bytecode● Cross-kompiliert in self-contained executable● Return Codes statt Exceptions● Funktionen sind First Class Citizens● Communicating Sequential Processes● Schnell
![Page 16: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/16.jpg)
~ Einer meiner Kollegen
Ich habe gehört, dass man in Go nicht so viel können muss...
![Page 17: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/17.jpg)
{go’s opinions
Simplicity
Jedes Sprachfeature soll einfach zu begreifen sein.
![Page 18: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/18.jpg)
go’s opinions
● Da “fehlt” etwas○ Keinen ternären Auswahloperator○ Keine Vererbung○ Keine Generics
● Tendenz zur Zuverlässigkeit○ G’scheite Pointer○ Garbage Collection○ Concurrency Paradigmen○ Return Codes
![Page 19: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/19.jpg)
{go’s opinions
Orthogonality
Features sollen vorhersehbar und konsistent funktionieren.
![Page 20: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/20.jpg)
Orthogonality am Beispiel Maps & Slices
https://play.golang.org/p/GtFlZvfCLvE
m := make(map[string]int)
m["k1"] = 2m["k2"] = 3m["k3"] = 5
mapValue := m["k1"]fmt.Printf("Value is %d\n", mapValue)
for k, v := range m { fmt.Printf("key=%s, value=%d\n", k, v)}
fmt.Printf("Length of map: %d\n", len(m))
s := make([]int, 3)
s[0] = 7s[1] = 11s[2] = 13
sliceValue := s[1]fmt.Printf("Value is %d\n", sliceValue)
for i, v := range s { fmt.Printf("index=%d, value=%d\n", i, v)}
fmt.Printf("Length of slice: %d\n", len(s))
![Page 21: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/21.jpg)
go’s opinions
● Großartig für System Programmierung○ Server (Netzwerk, Multi Core, etc)○ CLI (self contained)
● Suboptimal für Embedded und Desktop UIs○ Runtime (Größe und Garbage Collection)○ Kein natives UI Konzept
![Page 22: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/22.jpg)
go’s opinions
● Moderne Standard Library○ Network, Crypto, Templating, Encoding, etc
● Eigenwillige Standard Library○ JSON aber kein YAML○ Command Line Flags beeinflusst von Plan 9○ Webserver in 3 Zeilen, aber Slice hat
kein contains()
![Page 23: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/23.jpg)
go’s opinions
● Concurrency-Konzept basiert auf Communicating Sequential Processes○ C.A.R. Hoare 1978
● Goroutines○ Lightweight Threads
● Channels○ Pipelines○ Topics
![Page 24: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/24.jpg)
CodeEndlich...
![Page 25: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/25.jpg)
Hello World
package main
import "fmt"
func main() { name := "World" fmt.Println("Hello " + name + "!")}
Executable
Library
Type Inference
![Page 26: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/26.jpg)
Imports
package main
import ( "fmt" "github.com/julienschmidt/httprouter" "net/http" "log")
func Hello(w http.ResponseWriter, r *http.Request, ps httprouter.Params) { fmt.Fprintf(w, "hello, %s (using %s)!\n", ps.ByName("name"), r.UserAgent())}
func main() { router := httprouter.New() router.GET("/hello/:name", Hello) log.Fatal(http.ListenAndServe(":8080", router))}
![Page 27: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/27.jpg)
Unused Code
package main
import "fmt"import "os"
func main() { result := 7 + 11 fmt.Println("Hello World!")}
Unused import. ERROR.
![Page 28: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/28.jpg)
Unused Code
package main
import "fmt"
func main() { result := 7 + 11 fmt.Println("Hello World!")}
Unused variable. ERROR.
![Page 29: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/29.jpg)
Unused Code
package main
import "fmt"
func main() { fmt.Println("Hello World!")}
![Page 30: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/30.jpg)
Multiple Return Codes
package main
import "fmt"
func Names() (string, string) { return "Eduard", "Breuninger"}
func main() { n1, n2 := Names() fmt.Println(n1, n2)
n3, n4 := Names() fmt.Println(n3)}
Unused variable. ERROR.
![Page 31: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/31.jpg)
Multiple Return Codes
package main
import "fmt"
func Names() (string, string) { return "Eduard", "Breuninger"}
func main() { n1, n2 := Names() fmt.Println(n1, n2)
n3, _ := Names() fmt.Println(n3)}
![Page 32: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/32.jpg)
Multiple Return Codes + No Unused Variables
package main
import "fmt"
func pretendThisIsFancy() (string, error) { return "Eduard", nil}
func main() { name, err := pretendThisIsFancy() if err != nil { // shit what do I do? } fmt.Println(name)}
handling errorshandling errorshandling errors
![Page 33: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/33.jpg)
Types
f(o)
Go bietet keine Klassen. Stattdessen gibt es structs und function receivers.
o.f()
![Page 34: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/34.jpg)
Types
https://play.golang.org/p/aKXkOQNb1YX
type container struct { a int b int}
func multiply(c container) int { return c.a * c.b}
func set(c *container, a, b int) { c.a = a c.b = b}
-------------------------------------------
set(&container, 3, 5)result := multiply(container)
Go bietet keine Klassen. Stattdessen gibt es structs und function receivers.
type container struct { a int b int}
func (c container) multiply() int { return c.a * c.b}
func (c *container) set(a, b int) { c.a = a c.b = b}
-------------------------------------------
container.set(3, 5)result := container.multiply()
Hält Daten
Function ReceiverCall by Value
Call by Reference
![Page 35: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/35.jpg)
Interfaces
https://play.golang.org/p/aKXkOQNb1YX
type multiplier interface { multiply() int}
Ein Interface ist ein Sack voller Methoden. Typen die alle Methoden implementieren, implementieren das Interface.
Interfaces werden implizit implementiert. Es gibt keine explizite “implements” Deklaration.
func print(any multiplier) { fmt.Println("->", any.multiply())}
Sobald ein Typ über ein Interface benutzt wird, überprüft der Compiler, ob der Typ das Interface vollständig implementiert.
![Page 36: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/36.jpg)
Concurrency Demo
go get github.com/sebsprenger/eventdemo
Ein Beispiel mit Goroutines und Channels
generator filter dispatcher
handler
Waitgroup (sync)
handler
handler
![Page 37: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/37.jpg)
Was ich ausgelassen habe...
● Functions als First Class Citizens● Visibility (Exported/Unexported)● Module System
○ Package Management war bisher suboptimal○ Neuer Weg mit go1.11, 1.12, 1.13 (aktuell)
● Unit testing mit eingebauter Code Coverage● Cross-Compilation● und noch vieles mehr...
![Page 38: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/38.jpg)
ÖkosystemNicht nur eine Sprache
![Page 39: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/39.jpg)
Toolchain
● go○ get○ build, install, run, test○ doc○ generate○ fmt○ mod
![Page 40: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/40.jpg)
Community Sites
● golang.org○ tour.golang.org○ play.golang.org
● Go by Example○ gobyexample.com
● Effective Go○ https://golang.org/doc/effective_go.html
● Godoc.org
![Page 41: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/41.jpg)
golangZusammenfassung und Ausblick
![Page 42: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/42.jpg)
Zusammenfassung
● go → Sprache● #golang → Hashtag● Typisierte, (Cross)kompilierte, self-contained● Garbage Collected, Ohne Exceptions● Gebaut für Netzwerk & Multi-Core CPUs● Design-Prinzipien Simplicity & Orthogonality
○ Einfach zu begreifen○ Konsistent im Umgang
![Page 43: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/43.jpg)
Zusammenfassung
● Imports können heruntergeladen werden● Mehrere Return Values● Ungenutzte Imports/Variablen sind Fehler● Ständiges Error Handling● Structs, Functions und Interfaces statt Klassen● Goroutines und Channels für Concurrency
![Page 46: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/46.jpg)
Bücher
236 Seiten
Web Apps in Go, mit der Annahme, dass man grund- sätzlich Programmieren kann.
https://www.amazon.de/Level-Your-Web-Apps-Performance-ebook/dp/B00X6GVZ40/
![Page 47: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/47.jpg)
Bücher
280 Seiten
Rezepte aus der echten Welt. Ähnlich wie ein “Effective *” Buch.
https://www.amazon.de/Level-Your-Web-Apps-Performance-ebook/dp/B00X6GVZ40/
![Page 48: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/48.jpg)
Meine Ziele
● Überblick wieso Go ist wie es ist● Vorstellung von ausgewählten Sprachfeatures● Concurrency demonstrieren
Euch Bock machen auf Go
Ziele erreicht? Lasst es mich wissen @sebsprenger
● Code Beispiele● Vorstellung des Ökosystems● Weiterführende Informationen
Euch enablen Go auszuprobieren
![Page 49: 7 languages in 7 months, 2019-09-18 Einführung in Go Eine (nicht … · Eine (nicht ganz objektive) Einführung in Go 7 languages in 7 months, 2019-09-18 Sebastian Sprenger Software](https://reader033.vdocuments.mx/reader033/viewer/2022050111/5f488eb097cc76031f6c0e40/html5/thumbnails/49.jpg)
‘NUFF SAID