SIGN IN SIGN UP

types/jsonformat: add wrapper types for JSON custom formats

The json/v2 prototype used to support a `format` tag option,
which has been removed for the initial release of json/v2 in Go 1.27.

The wrapper types in this package provide a way to avoid using
the `format` tag option for all existing use-cases.

The types are written to cooperate with other tag options
such as `string`, which may stringify JSON numbers.
We adjust cmd/vet/jsontags accordingly.

Updates #20220
Updates tailscale/corp#45953

Change-Id: Ie1fcea41dc30983e9acc43085f42a6e8ee49d26e
Signed-off-by: Joe Tsai <joetsai@digital-static.net>
J
Joe Tsai committed
fa4bb7eae099d2f85621b6f99f2b6f4d10204d4f
Parent: 00699ab
Committed by Brad Fitzpatrick <brad@danga.com> on 8/8/2026, 12:38:20 PM