~/devtype

Go Typing Speed Test

Go's syntax is minimal, but its idioms are repetitive by design — `if err != nil` alone justifies dedicated typing practice. These drills cover channels, goroutines, and the declare-and-assign patterns Go programmers type hundreds of times a day.

LV 1
Level 0 / 100 XP
Best 0 WPM
main.js
00 wpm
00%
0s
1
Just start typing or click the code
Esc restart Enter new line, indentation is skipped for you

Drilling Go's Repetitive Idioms

The short variable declaration `:=` is Go's signature keystroke — colon-equals as one fluid motion separates fluent Go typists from everyone else. The error-check idiom `if err != nil {` follows nearly every function call, making the exclamation-equals sequence (`!=`) and immediate brace one of the highest-value chunks you can automate.

Channels introduce the receive arrow `<-`, which reads one way and types another: less-than then hyphen, in both send (`ch <- v`) and receive (`v := <-ch`) positions. Multi-value returns mean comma-separated assignment lists everywhere (`f, err :=`). Because gofmt enforces tabs, DevType's indent auto-skip lets you focus purely on the code characters.

Key Drills for Go:

  • One-motion walrus: Type `:=` as a single gesture. It's Go's most frequent operator by a wide margin.
  • Automate the err check: `if err != nil {` deserves its own muscle memory. You will type it thousands of times.
  • Arrow direction matters: Practice `<-` on both sides of a channel until send and receive feel identical.

Sample Drill: Goroutines & Channels

Spawning threads and communicating via channels in Go.

go-routine · medium
func worker(id int, jobs <-chan int, results chan<- int) {
	for j := range jobs {
		results <- j * 2
	}
}

All 15 Go Drills

Every session picks a random drill from this pool. Use the difficulty filter above to stay on easy warm-ups or jump straight to the hard ones.

  • Explicit Error Checking easy

    Classic Go error check pattern using multi-value returns.

  • Struct JSON Tags easy

    Control JSON field names and omitempty with struct tags.

  • Slices and Range easy

    Append to a slice and print each element with its index.

  • Map Comma-Ok Lookup easy

    Check whether a key exists in a map before using its value.

  • Time Formatting easy

    Format timestamps with RFC3339 and Go's reference layout.

  • Goroutines & Channels medium

    Spawning threads and communicating via channels in Go.

  • HTTP Handler & Mux medium

    Registering an HTTP handler that writes a JSON response.

  • Interface & RWMutex medium

    Define a storage interface and a thread-safe in-memory version.

  • Strict JSON Decoding medium

    Decode a size-limited request body and reject unknown fields.

  • Table-Driven Test medium

    The idiomatic table-driven test pattern with t.Errorf.

  • Sentinel Errors medium

    Map a sentinel error to an HTTP status with errors.Is.

  • Bounded errgroup hard

    Run jobs concurrently with errgroup, a limit, and shared cancel.

  • Logging Middleware hard

    Wrap an http.Handler to log method, path, status, and duration.

  • Context-Aware HTTP Call hard

    Make an outbound GET that honors the caller's context deadline.

  • Generic SumBy hard

    A generic helper with a numeric type-set constraint.

The Symbols That Slow You Down

The keystrokes below are where Go typing speed is won or lost. Key positions shown for QWERTY — the pattern transfers to any layout, just on different physical keys.

Symbol Used For Keys How to Drill It
:= Short declaration : as Shift+Semicolon, then = unshifted Go's signature operator. Colon-then-equals must be one fluid gesture — you'll type it dozens of times a day.
<- Channel arrow < as Shift+Comma, then - unshifted Reads one way, types the other. Appears in send (`ch <- v`) and receive (`v := <-ch`) positions.
!= Not equal ! as Shift+1, then = unshifted The heart of `if err != nil`. Shift-one-then-equals should be a single reflex.
& Address-of Shift+7 `&x`, `&Person{}` — taking addresses is constant. And `&&` in conditions means two Shift-7 strikes.
* Pointer type / deref Shift+8 `*T` declarations and `*p` dereferences. Shift-8 should cost no attention at all.
... Variadic Three periods, unshifted In signatures (`nums ...int`) and spreads (`append(s, xs...)`). Keep an even three-strike rhythm.

Common Go Typing Mistakes

  • ✗ Typing `=` first in `:=` — the walrus is colon-then-equals. Slow, deliberate reps until the order is locked.
  • ✗ Forgetting the spacing in `if err != nil {` — practice the whole idiom as one memorized string.
  • ✗ Reversing `<-` into `->`: both arrows exist in Go, and the direction changes the meaning.

What's a Good Go Typing Speed?

Go types faster than it looks on paper — short keywords, but heavy idiom repetition: 35–50 WPM is a solid working range, with 55+ WPM and 97% accuracy being excellent. If `if err != nil` costs you a pause, that's the drill to run.