We break down how to design function contracts in Go: when it makes sense to return
bool (predicates), when
(T, bool) is better (lookup/get without “magic values”), and when you need
error or
(T, error) (the reason for failure matters). Using TodoLite examples, we compare the semantics of “not found” vs “error”, collect selection criteria into a table, and lock the decision in with a flowchart (mermaid). Finally, we cover typical mistakes when choosing a contract and how to avoid them.