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