DevPath

Scan rows safely and check for errors

Mid · practical lab · 25 min · runtime go

Brief

Write listUsers(ctx, db) that uses QueryContext, defers rows.Close, checks rows.Err after the loop, and scans each row into typed fields.

3 progressive hints are available in the editor.

Public checks

  • closes rows — expected: defers rows.Close