Go โ Programming Language Training
Last reviewed: 2026-05-29
Go (Golang) is a statically typed, compiled programming language designed at Google for building efficient, reliable software at scale. Known for its simplicity, built-in concurrency, and fast compilation, Go is widely used in cloud infrastructure, microservices, CLI tools, and networking.
Overview
Go emphasizes:
- Simplicity โ A small language spec with minimal keywords
- Concurrency โ Goroutines and channels (CSP model)
- Fast compilation โ Compiles to a single static binary
- Built-in tooling โ go fmt, go test, go mod, go vet
- Standard library โ HTTP server, JSON, encryption, templates, testing
Training Content
Reference Materials
Practical Projects
diskutils โ Disk Partition Utility (main.go)
A Go utility that lists all disk partitions on the system using the gopsutil/v3/disk package.
package main
import (
"fmt"
"github.com/shirou/gopsutil/v3/disk"
)
func main() {
all_devices, _ := disk.Partitions(true)
if len(all_devices) == 0 {
fmt.Println("No disks found")
return
}
for _, device := range all_devices {
fmt.Printf("Device is %s The Mountpoint is %s and the type is %s \n",
device.Device, device.Mountpoint, device.Fstype)
}
}
Key concepts:
- Third-party package management with go mod
- Using gopsutil (Go PS utilities) for OS-level disk info
- Iterating partition data (device path, mount point, filesystem type)
- Error handling in Go (multiple return values)
Data files:
- JSON files (esvmgsw210.json, indexHostnameVmDrqsFirst100.json, etc.) โ Server inventory/Hostname-VM mapping data from a Bloomberg SOR project
- CSV files (SORserversContactsRemoved.csv) โ Large server contact database
- fake_api/ โ A fake HTTP API server with its own Go code, serving server data endpoints
kafka-go โ Kafka Integration
A Kafka client module using the kafka-go library:
main.goโ Producer/consumer example for Apache Kafka messagingutils.goโ Helper functions for Kafka connection handlingorder.pb.goโ Protocol Buffers generated code for order messages
Key concepts: - Kafka messaging in Go - Protocol Buffers for message serialization - Go module dependencies and versioning
helloGo
Basic Go introduction project โ syntax, variables, control flow, functions.
Key Go Concepts
| Concept | Description |
|---|---|
| Packages & modules | package main, go mod init, import paths |
| Multiple returns | func div(a, b int) (int, error) |
| Goroutines | go funcName() โ lightweight threads |
| Channels | ch := make(chan int) โ typed communication pipes |
| Interfaces | Implicit implementation โ "duck typing" at compile time |
| Structs | Type composition over inheritance |
| Error handling | Explicit error returns, no exceptions |
defer |
Scheduled cleanup (close file, unlock mutex) |
Resources
- Go Documentation
- Go by Example
- Effective Go
- gopsutil โ Go process/system utilities
- kafka-go โ Kafka client for Go
- Fyne UI Toolkit โ Cross-platform GUI (separate training file)