← All courses

Training

Go Lang Foundations

Go Lang Foundations

From Core to Web Services in three intensive days.

This 3-day course is designed for developers who want direct, industry-relevant training in the Go programming language and its ecosystem. The instructor has over 30 years of industry experience and focuses on real-world patterns and tasks rather than purely academic abstractions. We’ll start with the foundations of Go—its syntax, standard library, concurrency model—and then move into building a web service using Go’s web-capabilities and modern tooling.

Learning Outcomes

By the end of this course you will be able to:

  • Write clean, idiomatic Go code using Go’s core syntax and conventions.
  • Understand and use Go’s key features: standard library, error handling, modules, concurrency (goroutines & channels).
  • Set up a Go project using modules, build and run your application across platforms.
  • Build a RESTful web service in Go: define handlers, routes, middleware, error handling, logging.
  • Integrate data persistence, configuration, and deploy a Go web service in a production-mindset.
  • Apply best practices for writing scalable, maintainable Go services: modular packages, testing, tooling, observability.

Prerequisites

  • Prior programming experience (in any language): variables, loops, functions/methods.
  • Familiarity with using an IDE or text editor and basic command line (terminal).
  • Understanding of HTTP / web concepts (requests/responses) is helpful but not strictly required.
  • A computer with Go version 1.24 or later installed (latest release at time of writing).
  • Ready to code hands-on and engage in real-world style examples.

Course Outline

  1. Introduction & Setup
    1. Course overview, objectives, and expectations
    2. Installing Go (latest version), setting up workspace (GOPATH, modules)
    3. Go toolchain: go build, go run, go test, go mod
    4. Project structure and version control basics for Go
  2. Go Language Fundamentals
    1. Basic syntax: packages, imports, functions, variables, constants
    2. Data types, zero values, composite types (arrays, slices, maps)
    3. Control flow: if, for, switch, goto (rarely), and defer
    4. Functions: multiple return values, named returns, variadic parameters
  3. Go Types, Structures & Composition
    1. Structs, methods, interfaces, embedding (composition)
    2. No traditional inheritance; using interface-based design and composition
    3. Pointers, value vs reference semantics
    4. Go’s approach to OOP-like patterns and idiomatic Go style
  4. Error Handling, Testing and Modules
    1. Error handling in Go: error as value, idiomatic patterns
    2. Using defer, panic, recover carefully
    3. Writing tests: testing package, benchmarks and examples
    4. Go modules: go.mod, semantic versioning, module-aware builds
  5. Standard Library Highlights & Concurrency
    1. Key packages: fmt, io, os, net/http, encoding/json — and how to use them effectively.
    2. Concurrency with goroutines and channels: creating goroutines, channel patterns, select statement.
    3. Synchronisation primitives: sync, atomic, context cancellation.
    4. Performance considerations: Go’s fast compilation, efficient runtime.
  6. Modern Go Features & Best Practices
    1. Latest features in Go (v1.24/1.25): generic type aliases, performance improvements, new standard-library additions.
    2. Code structure: clean package design, separation of concerns, dependency injection-like patterns in Go.
    3. Tooling: go vet, golint, go fmt, profiling/benchmarking, modules maintenance.
    4. Logging, configuration, environment variables, CI/CD basics in Go services.
  7. Building Web Services in Go
    1. HTTP handlers and routing: using net/http, or a routing framework if chosen (e.g., mux)
    2. Middleware patterns: logging, authentication, request metrics
    3. JSON payloads: encoding/decoding, validation, error responses
    4. RESTful service design: endpoints, status codes, versioning
    5. Configuration: reading from env, files, using context for request-scoped values
  8. Data Persistence & Integration
    1. Connecting to databases: basic use of database/sql, or an ORM/mapper package
    2. Struct tags for JSON/DB mapping, entity design
    3. Transaction management, connection pooling
    4. External integrations: calling external APIs, background tasks/goroutines
  9. Building for Production & Deployment
    1. Packaging and cross-compilation: building for different OS/architectures
    2. Observability: metrics, tracing, logging in Go services
    3. Deployment patterns: containerisation (Docker), microservices considerations
    4. Error handling, graceful shutdowns, signal handling
    5. Security best practices: input sanitization, TLS, secrets management

Practical, connected learning

My wider training approach brings hands-on implementation and systems thinking together, connecting technology with real operational needs.