From 1f8a3b7beefcd58cfad5b7acdc96f04ca475a89d Mon Sep 17 00:00:00 2001 From: Tom Fleet Date: Thu, 11 Sep 2025 08:41:01 +0100 Subject: [PATCH] Use examples in Extra and ExtraMap --- problem.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/problem.go b/problem.go index 6849f56..ec13fee 100644 --- a/problem.go +++ b/problem.go @@ -194,6 +194,8 @@ func Status(status int) Option { // // Clients consuming problem details MUST ignore any such extensions that they don't recognize; // this allows problem types to evolve and include additional information in the future. +// +// prob := problem.New(problem.Extra("account_id", 123456)) func Extra(key string, value any) Option { return func(p *Problem) { // In case it hasn't been initialised yet @@ -216,6 +218,8 @@ func Extra(key string, value any) Option { // // Clients consuming problem details MUST ignore any such extensions that they don't recognize; // this allows problem types to evolve and include additional information in the future. +// +// prob := problem.New(problem.ExtraMap(map[string]any{"account_id": 123456})) func ExtraMap(extra map[string]any) Option { return func(p *Problem) { p.Extra = extra -- knotmirror 0.0.1