Go—Beyond the Basics
October 3 & 4, 2016
9:00AM – 5:00PM EDT
O’Reilly’s Boston Training Center, Boston, MASee ticket options
Course limited to 40 people. Sign up before it sells out!
Join Brian Ketelsen in the O’Reilly Boston Training Center for a hands-on, practical exploration of advanced topics in Go. Using labs and live coding sessions, Brian takes you beyond the Go you know to the advanced concepts that will help you create faster, more robust, and more maintainable applications.
You’ll learn the right way to manage errors, how to handle communications with unreliable external services, how to benchmark and profile your applications, and how to find and fix hotspots and bottlenecks in your applications, as well as patterns and techniques to make your code easier to test. By the end of the training, your code will look like it belongs in Go’s standard library.
Whether you’re building web applications, network services, or command-line applications, the skills you’ll master in this course will take you—and your Go applications—to the next level.
What you’ll learn—and how you can apply it
By the end of this live, hands-on course, you’ll understand:
- How to write idiomatic Go code that is concise, fast, and easy to test
- How to use Go’s powerful interfaces to enable code reuse
- How to use more of Go’s standard library and reduce your dependencies on external code
- When and how to use Go’s powerful concurrency primitives like mutexes and channels
And you’ll be able to:
- Gracefully handle errors
- Build applications that are more resilient, easier to monitor, and easier to maintain
This course is for you because…
- You are an experienced Go developer ready to take your applications to the next level of professionalism and reliability
- You have created some Go applications in your organization, and it’s time to take them into production
- You have a team of Go developers looking for best practices and advanced techniques to build a sustainable Go ecosystem at your company
- Experience building Go applications
- A basic understanding of Go concepts (e.g., types, functions, and interfaces)
- Experience using code from Go’s standard library or external Go packages written by other people
Materials or downloads needed in advance:
- A Go compiler, configured to work on your laptop
- Your favorite code editor
- Day One
- Writing code like the Go team (60 minutes)
In the first section of the course, you’ll learn how to make your code look like it belongs in Go’s standard library—and why that’s important. We’ll cover how to organize your code into packages and what those packages should contain and look at the code patterns and conventions that are prevalent in the standard library. You’ll discover how to write clearer and more understandable code and learn the unwritten Go conventions that go beyond “go fmt” and make you look like a veteran Go contributor.
- Naming conventions
- Source code conventions
- Effective error management (60 minutes)
In this section, you’ll learn how to effectively handle errors in Go by exploring examples of several wrong ways to handle errors and better alternatives. You’ll learn when it’s appropriate to handle an error and when it’s appropriate to pass the error back up the call stack and discover some of the subtle ways that your errors can cause problems for the users of your packages. You’ll end up with a clear guideline for error handling, in both your library code and applications.
- Comparing errors with known types
- Exporting errors
- Libraries are different
- Annotating errors
- Wrapping errors for clarity
- Embracing the standard library (60 minutes)
Here, you’ll learn how to get the most out of Go’s amazing standard library. We’ll look at several standard library packages that are highly useful but often ignored, explore the common interfaces in the standard library, and see how to use them effectively. You’ll learn how to write code that is more efficient and requires fewer dependencies.
- Hidden gems in Go’s standard library
- Common interfaces
- Using stdlib for maximum effect
- Creating useful interfaces (60 minutes)
In this section, we’ll look at Go’s interfaces and learn how to employ them for maximum flexibility and code reuse. We’ll single out several interfaces from the standard library and explore what makes them so powerful. You’ll learn how to make your abstractions count with small and concise interfaces.
- What makes a good interface
- Standard library interface examples
- Interface size versus interface utility
- Wrangling concurrency (90 minutes)
In this section, we’ll explore advanced techniques to enable concurrency in your applications. You’ll learn when and how to use channels and mutexes, as well as the common pitfalls of each option, and how to detect and prevent data races and common concurrency errors. You’ll also get practical experience using advanced tools like sync.WaitGroup and sync.ErrorGroup to make your concurrent applications more reliable.
- Race detection
- Day Two
- Profiling and benchmarking (90 minutes)
We’ll begin the second day by exploring ways you can make your application faster using Go’s tools for profiling, benchmarking, and optimization. Live demonstrations of profiling and optimization workflows and hands-on labs and assignments will give you firsthand experience that you can use to find the performance bottlenecks in your applications.
- pprof and debug/pprof
- Go tool trace
- Writing code to be fast the first time (90 minutes)
In this section, you’ll build on what you learned from profiling and benchmarking to explore advanced techniques to create code that is fast the first time. You’ll learn how to minimize the garbage created in your application, how to build reusable pools of expensive resources, and other advanced tricks to make your applications faster and avoid problems before they happen.
- Arrays and slices
- Make GC faster by creating less garbage
- Avoiding unnecessary conversions
- Use the stack
- Testing in the real world (60 minutes)
Here, we’ll explore real-world code from open source Go projects to learn how to write code that is testable. You’ll discover how to create packages, functions, and types that are more testable and how to test those hard-to-test corners of your code that are often ignored, as well as advanced techniques that will give you more confidence when you ship your code.
- Writing testable code
- Interfaces and mocks
- Integration tests
- Testing hard-to-test code
- Writing scalable services (90 minutes)
In this section, we’ll cover advanced patterns and techniques for building applications that scale beyond your staging environment and into real-world usage. You’ll learn how to prevent resource exhaustion by using timeouts and cancellations and how to measure the potential performance of your application to determine the theoretical maximums that your application can handle with a single instance.
- Timeouts and cancellations using Contexts
- Measuring throughput
- Determining your limits
- Measuring, monitoring, and logging
- Building resilient applications (60 minutes)
In the final section, we’ll discuss techniques and tools you can use to keep your application running in a world of unreliable networks and cloud services. You’ll explore rate limiting to keep greedy consumers from taking your application offline and build circuit breakers to prevent cascading failures, and you’ll learn patterns for graceful retries, backoffs, and fallbacks for those times when the world around your application collapses.
- Circuit breakers
- Rate limiting
- Retries, backoffs
- Graceful fallbacks
The course will be held at the O’Reilly Boston Training Center: 2 Avenue de Lafayette, 6th floor, Boston, MA 02111
Lunch will be provided.
Rental Car Discounts
If you need a rental car while attending the conference, you may go to the Hertz Interactive Reservation System to receive the special O’Reilly discount on rental cars for the conference. Or call Hertz Reservations at (800) 654-3131 and mention code #01XY0041.
United Airline Discount
To receive your 3%–10% Discount on United Airlines flights to our event, you can book online at united.com and provide discount Code ZVUR591372. Or, for a $25 service fee you can call United Meetings at (800) 426-1122 where a ticketing agent can help you by phone.
Working as a team? Learn as a team.
Taking this course as a team ensures that everyone is on the same page and understands both the immediate and long-term and immediate goals of your project. Exploring new ideas and collaborating on exercises together is a great team-building experience; everyone on your team will have the opportunity to ask questions, discuss use cases, and learn from other participants.
For group tickets and enterprise licensing, please contact email@example.com
Code of Conduct
All participants must follow our Code of Conduct, the core of which is this: an O’Reilly events should be a safe and productive environment for everyone. Read more
O’Reilly Media, Inc. assumes no responsibility or liability for the facilities or services provided by the vendors and suppliers. Anyone attending this event releases O’Reilly from any and all claims that may arise out of attending at this event.