What is this?
The Gopher Proving Grounds is a hands-on way to test your knowledge of
basic Go programming and the important APIs you'll reach for every day —
command-line flags, reading files, standard input/output, encoding, bit
twiddling, network programming, concurrency, HTTP, gRPC, and even a little
cryptography. You write a small program
called goferit; the trial
builds it and runs it through a gauntlet of checks.
It's a great companion to gorgo.dev/go: read and work the exercises up to chapter 14 (they are quick chapters), then come here to prove you can actually put it to work.
What you'll prove
Each stage of the trial reveals the next as you run it — but here's the lay of the land, and the gorgo.dev/go chapters and sections that cover what each one asks of you.
Hello, gopher
Covers
- Ch. 1 Hello, Go — the
fmtpackage - Ch. 1 Hello, Go — command-line arguments
A proper usage message
Covers
- Ch. 14 Essential Standard Library — the
flagpackage
Read from stdin
Covers
- Ch. 1 Hello, Go — reading input
- Ch. 3 Strings, Bytes, and Runes —
strconv
Files & flags
Covers
- Ch. 14 Essential Standard Library —
osfiles - Ch. 3 Strings, Bytes, and Runes — the
stringspackage
Decode the message
Covers
- Ch. 14 Essential Standard Library —
encoding/base64
Untwist the bytes
Covers
- Ch. 2 Types and Variables — integer &
bytetypes (shift & OR)
Talk to a server
Covers
- Ch. 15 JSON, HTTP, and the Web — raw TCP with the
netpackage (net.Dial) - Ch. 3 Strings, Bytes, and Runes —
strconv
Run your own server
Covers
- Ch. 15 JSON, HTTP, and the Web — listening with
net(net.Listen&Accept)
Echo with goroutines
Covers
- Ch. 10 Goroutines and Channels — concurrent connections
- Ch. 15 JSON, HTTP, and the Web — raw TCP with the
netpackage
Fetch over HTTP
Covers
- Ch. 15 JSON, HTTP, and the Web — HTTP clients (
http.Get)
Serve the web
Covers
- Ch. 15 JSON, HTTP, and the Web — HTTP servers, handlers & status codes
Speak gRPC
Covers
- Ch. 16 gRPC — protocol buffers & calling a unary RPC
Answer the call
Covers
- Ch. 16 gRPC — implementing a gRPC server
Crack the cipher
Covers
- Ch. 7 Maps and Slices — walking a word map
- Ch. 14 Essential Standard Library — Seeding and Reproducibility (
math/rand/v2) - Ch. 15 JSON, HTTP, and the Web — unmarshalling JSON
Getting started
Welcome to the start of your journey to becoming an experienced
gopher! For the first stage, create a simple Go program called
goferit that takes a command-line argument and says hello.
The trial runs the following in the directory you point it at:
go build
./goferit Geree
and expects the output to be:
Hello! I am Geree
If you're using the gorgo.dev/go book, you'll find everything you need for this task in the first chapter. Good luck, and may the source be with you!
Run the trial
The trial ships as a Docker image with the Go toolchain baked in.
Mount the directory that holds your goferit sources (the one with your
go.mod) at /submission and run it. On Linux
and macOS (Terminal, bash/zsh):
docker run --rm -v "$PWD:/submission" ghcr.io/breed/goferit:latest
The image checks the mount for you first: if the -v flag
is missing or points at the wrong place, it prints these run instructions instead
of failing with a confusing error, then stops so you can try again.
macOS
The command above works as-is — just make sure Docker Desktop is running first. File sharing and ownership are handled automatically, so nothing else is needed.
Windows
$PWD isn't a Windows thing, so use your shell's
current-directory variable instead (and make sure Docker Desktop
is running). In PowerShell:
docker run --rm -v "${PWD}:/submission" ghcr.io/breed/goferit:latest
In Command Prompt (cmd.exe):
docker run --rm -v "%cd%:/submission" ghcr.io/breed/goferit:latest
Run it from the folder that contains your go.mod. If you
use a drive other than C:, enable it under Docker Desktop →
Settings → Resources → File sharing.
May the source be with you. 🦫⚔️