Go Next Steps
Published by O'Reilly Media, Inc.
Writing effective and idiomatic production-grade Go
Join expert Johnny Boursiquot to level up your Go. You’ll reinforce the basics before honing advanced techniques with an idiomatic approach to language. Along the way, you’ll learn best practices for project layout, testing, reusability, and dependency management. Discover how to use the Go toolchain, build CLI tools, and write robust HTTP servers and clients. Understand good package design and error handling strategies. See how to leverage the powerful Go standard library for common needs—and manage external dependencies effectively when you need them. And dive into Go’s concurrency primitives, techniques, and patterns.
By the time you’re through, you’ll know what production-grade Go code should look like and be able to apply those techniques to your own projects with confidence.
What you’ll learn and how you can apply it
By the end of this live online course, you’ll understand:
- How to build robust command-line tools
- How to write more testable code with interfaces
- How to leverage Go’s concurrency primitives as well as common patterns that help you get through workloads fast
And you’ll be able to:
- Master Go fundamentals, including working with its simple and complex types, collections, polymorphism, code organization, and more
- Couple the built-in testing package with techniques that help improve coverage and correctness
- Build resilient HTTP servers and clients
- Use Go modules to manage dependencies
This live event is for you because...
- You want to explore common use cases for Go that you might encounter on the job.
- You’re somewhat new to Go and want to know how to write idiomatic and production-grade code.
- You want to embark on new Go projects or tackle existing ones with confidence.
Prerequisites
- A computer with Go 1.13+ installed and configured (Optional: Install an editor with Go support—VS Code + the Go extension, for example.)
- A working knowledge of Go
- Familiarity working in a terminal
- A basic understanding of AWS Lambda
Recommended preparation:
- Explore A Tour of Go (website)
- Explore Go by Example (website)
- Take Serverless Go (live online training course with Johnny Boursiquot)
Recommended follow-up:
- Read Mastering Go (book)
- Read “Effective Go” (article)
- Explore Go Code Review Comments (GitHub doc)
- Read “Package Testing” (article)
- Read “Table-Driven Tests” (article)
- Read “Testable Examples in Go” (article)
- Read “Using Subtests and Sub-benchmarks” (article)
Schedule
The time frames are only estimates and may vary according to how the class is progressing.
Must-know fundamentals (40 minutes)
- Presentation: Go basic types and constructs; how Go does OO; syntax; common uses; gotchas
- Hands-on exercise: Leverage your newfound knowledge
- Q&A
Break (5 minutes)
Building tools (45 minutes)
- Presentation: Building command-line tools; advanced language constructs such as pointers, structs, and methods; the Go toolchain
- Hands-on exercise: Build a tool that performs I/O and pulls in its configuration from the environment
- Q&A
Testing and interfaces (40 minutes)
- Presentation: Testing in Go; how to use the standard library to write tests; techniques such as table-driven testing, subtests, benchmarks, and mocks using interfaces
- Hands-on exercise: Apply the techniques to make an application more testable, including mocking remove services
- Q&A
Break (5 minutes)
HTTP servers and clients (30 minutes)
- Presentation: The fundamentals of building HTTP servers and clients in Go; handlers, multiplexers, and leveraging the context package for cancellation propagation; testing HTTP-based applications
- Hands-on exercise: Write robust servers and clients that can handle intermittent disconnects and long requests effectively
- Q&A
Modules and managing dependencies (25 minutes)
- Presentation: Dealing with dependencies with Go’s module system to ensure repeatable builds; common usage patterns; tips and tricks of working with the Go toolchain to wrangle your dependencies
- Hands-on exercise: Create your own module and use it in your code; upgrade and release your module updates without breaking code that relies on it
- Q&A
Break (5 minutes)
Concurrency (35 minutes)
- Presentation: How concurrency primitives work in Go; using Goroutines to do work; using locks to ensure exclusive access to shared resources; using channels to enable communication; when and how to leverage unbuffered and buffered channels; concurrency patterns in action
- Hands-on exercise: Leverage Goroutines and channels to synchronize access to a shared resource
Wrap-up and Q&A (10 minutes)
Your Instructor
Johnny Boursiquot
Johnny Boursiquot is a multi-disciplined software engineer with over two decades of experience and a love for teaching and community-building. He stays busy as an educator, speaker, and advocate within the Go programming language community where he also frequently serves as podcast host, user group organizer, and conference program chair. He is currently the Chief Technology Officer at Skilltype.