GO LEARNING PATH · 8 LESSONS
Standard library patterns
io.Reader and io.Writer, encoding/json, and testing without a framework.
Two interfaces, one method each
Write a function that works on a file, a string and a test buffer.
3 min · Worked lesson
Struct tags are the JSON schema
Control field names, omit empties, and know what unmarshalling leaves untouched.
3 min · Prediction challenge
A Duration is a number of nanoseconds with a type
Write a timeout without wondering what unit it is in.
3 min · Prediction challenge
Sorting by whatever you like
Sort a slice of structs by two keys.
3 min · Worked lesson
Every blocking call should take a context
Make a function that waits stop waiting when told to.
3 min · Worked lesson
http.Handler is one method, like Reader
Serve /hello from an in-memory request, with no listen.
3 min · Worked lesson
strconv is how text becomes a number
Parse a port with Atoi and reject anything outside 1…65535.
3 min · Worked lesson
image.Image is three methods, not a file
Implement a solid-colour image the standard library will accept.
3 min · Worked lesson