Go

Go - Eenvoudig, Efficiënt, Gelijktijdig

Overzicht

Go (ook wel bekend als Golang) is een open-source programmeertaal die is ontwikkeld door Google, geïntroduceerd in 2009, en bijzonder geschikt is voor het bouwen van moderne gedistribueerde systemen en cloud-native applicaties.

Kenmerken

  • Gelijktijdigheid: Lichtgewicht goroutines en kanalen
  • Vuilnisophaling: Ingebouwde automatische geheugenbeheer
  • Snelle compilatie: Incrementele compilatie met extreem snelle buildtijden
  • Statische linking: Compileert naar één uitvoerbaar bestand
  • Uitgebreide standaardbibliotheek: Uitgebreide standaardbibliotheek
  • Platformonafhankelijk: Ondersteunt Linux, macOS, Windows en meer

Snel aan de slag

Installatie

# Linux/macOS
wget https://go.dev/dl/go1.21.5.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.21.5.linux-amd64.tar.gz

# macOS (Homebrew)
brew install go

Verificatie

go version

Eerste programma

package main

import "fmt"

func main() {
    fmt.Println("Hello, Go!")
}

Uitvoeren:

go run main.go

Documentatie

Bronnen