Single Day Go Overview
In this class, we will cover the key architectural and design aspects that distinguish Go from other imperative languages, including Go's approach to object oriented programming and concurrency. We will also learn how these characteristics make Go a strong choice for applications that demand fast development, reliability, and scalability.
Full lesson material, taught over multiple two-day courses, can be found in the Hardcore Go section. Please see the gotraining README for contact information.
Examples marked with an asterisk are from golang.org, provided under a BSD license.
For a great talk/video that reinforces many of these ideas, see Andrew Gerrand's Code that Grows with Grace.
Syntax and Type Semantics
Easy to learn and reason about, trivial to machine-process.
Variables, Builtins, and Type Safety (Source)
Constants (Source)
Structs (Source)
Pointers and Reference Types
Safe and simple. Strings and slices solve many traditional pointer use-cases.
Arrays (Source)
Slices (Source)
Appending (Source)
Strings (Source)
Variadic Functions (Source)
Maps (Source)
Pointers (Source)
Peano Pointers (Source) *
Methods and Interfaces
Allow your code to grow gracefully without you.
Methods (Source)
Fibonacci Closures (Source) *
First-Class Methods (Source)
Interfaces (Source)
Embedding and Composition
An extension/wrapping mechanism based on composition, not inheritance.
Embedding (Source)
Embedding and Interfaces (Source)
Composition (Source)
Concurrency
Goroutines and channels for convenient and safe concurrent algorithms.
Concurrent Pi (Source) *
Concurrent Prime Sieve (Source) *
Select (Source)
Standard Library
Excellent value for its volume. I/O is especially powerful.
Packages and Exporting
Errors (Source)
Error Variables (Source)
Behavior As Error Context (Source)
Basic cURL
Enhanced cURL
HTTP Server
Universally adopted formatting, testing, and build tools. Many analysis tools are available (and custom tools are easy to write).
Tooling Overview
All material is licensed under the Apache License Version 2.0, January 2004.