Skip to content

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 messaging
  • utils.go โ€” Helper functions for Kafka connection handling
  • order.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

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