Radar · Go · Archive · Week 22 · May 25 – 31, 2026
Decoder.DisallowDuplicateFields
Worth knowingstdlib
- What changed
- The standard library now offers a
Decoder.DisallowDuplicateFieldsoption that, when enabled, rejects JSON input containing duplicate field names. - Production impact
- The source does not say.
- Try it
- Create a
json.Decoder, setDisallowDuplicateFieldstotrue, and attempt to unmarshal JSON with repeated keys. - Source
- github.com/golang/go/issues/48298
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed