Skip to content
Codewilds

Lesson 30 of 38 · Interfaces & Errors

Quiz: Go Interfaces and Errors

Quizmedium10 XP1 min read

You can now write flexible Go code with interfaces: types satisfy them implicitly, a slice of interface values lets one loop handle many types, and pointer receivers decide whether T or only *T implements an interface. Type assertions and type switches get concrete values back out, and the comma-ok form keeps them from panicking.

On the error side, you return error values instead of throwing exceptions, check if err != nil right away, declare sentinel errors, build custom error types, and wrap errors with %w so that errors.Is and errors.As can still find the cause. Answer these six questions before you face the chapter boss.

What this quiz covers

The questions check what you learned in the Interfaces & Errors chapter of Learn Go. Not sure about a topic? Review its lesson first:

Keep learning

Need a quick reminder? The Go cheat sheet has every topic of Learn Go on one page.

Lesson last updated on .

Take the quiz ↓
Quiz+10 XP

Lesson 30 is part of the full course. The first 9 lessons are free.

Premium lesson

Unlock the full Learn Go course

  • All 38 lessons, bosses and quizzes — lifetime access
  • One payment of $35, no subscription
  • Finish within 30 days and claim $10.50 (30%) back
Play the 9 free lessons

Want more than one course?

The All-Access Pass unlocks all 8 courses and every new one we release, for $120 once.