One day with Go (Getting Started)
March 28, 2021
Warum Go?
- Schnelle Builds, einfache Syntax
- Starke Standard Library
- Concurrency via Goroutines/Channels
Hello World
code
package main
import "fmt"
func main() {
fmt.Println("Hello Go")
}
Run & Build
code
go run main.go
go build
Imports
code
import (
"fmt"
"os"
)
Unbenutzte Imports sind Fehler (Compiler).
Docs
code
go doc math/rand
Hinweise
gofmtist Standard- Semicolons werden automatisch eingefuegt