Go fundamentials


  • Package system
  • Strong statically typing
  • Compiled
  • Statically linked binaries by default
  • Build in testing tools
  • Fewer keywords, e.g. only one loop, for
  • A func can return 0 - n values, common a value and an err
  • Every var must be used (expect blank _)
  • Variables are only available in the scope in which they were declared
  • C on steroides

1 This presentation is build with Hugo and the reveal.js theme reveal-hugo


Simple types linke string, int, bool, array, slice
Complex types and it’s functions like net.IP, time.Duration
Collection of fields (struct) like url.URL

Explicit conversion between types required!


Go command

# module maintenance
go mod
# initialize new module in current directory
go mod init github.com/t3easy/hello-go
# add missing and remove unused modules
go mod tidy
# add dependencies to current module and install them
go get github.com/spf13/cobra@latest
# test packages
go test ./...
# compile packages and dependencies
go build
# update dependencies
go get -u ./...
# update with test dependencies
go get -t -u ./...



Every Go program is made up of packages.
Programs start running in package main.
Standard lib, internal and external packages must be imported.

Go module

Every module has a name, preferable the repo url

go mod init github.com/t3easy/hello-go
  • go.mod - Module name, Go version and dependencies
    like composer.json
  • go.sum - Checksum of direct and indirect dependencies
    like composer.lock
As of Go 1.13, the go command by default downloads and authenticates modules using the Go module mirror and Go checksum database run by Google.

Setup dev system

Install Go


Hello go!


Thanks for attention