DevPath

Depend on an interface, not a struct

Mid · practical lab · 25 min · runtime go

Brief

Define a Store interface with Get(ctx, id) and Save(ctx, user), give the service a field of that interface instead of a concrete struct, and explain how this improves testability.

3 progressive hints are available in the editor.

Public checks

  • defines the interface — expected: Store interface with Get and Save