fix(decode): report the smallest unknown field deterministically

Assisted-by: GLM 5.3
This commit is contained in:
2026-09-17 23:11:38 +02:00
parent 4def1b3e8b
commit 3c8ac859c0
4 changed files with 42 additions and 4 deletions
+2 -1
View File
@@ -186,7 +186,8 @@ A typo such as `database_urls` then fails with
`interpres: unknown field "database_urls" for main.Config` instead of a silent
default-zero run. Strictness applies to every struct the decode reaches, at any
depth, including struct elements inside slices; map destinations accept every
key by nature.
key by nature. When several keys are unknown, the message names the smallest
one, so it does not depend on map iteration order.
### Cancellation