Assisted-by: GLM 5.3 Flash
This commit is contained in:
@@ -46,6 +46,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
(10000 levels, which no hand-written document approaches): a document that
|
||||
nests arrays or inline tables deeper used to run the stack out and is now
|
||||
rejected with a `SyntaxError` naming the limit.
|
||||
- The `toml` tag gained the `required` option: a field tagged
|
||||
`toml:"host,required"` makes the decode fail with
|
||||
`missing required key "host"` when the document carries no key that
|
||||
resolves to it. The option shapes decoding only, and the encoder ignores
|
||||
it.
|
||||
- `UnmarshalerContext`, the custom-decode interface that hands the decode's
|
||||
context to the method, `UnmarshalTOMLContext(ctx, data)`. It wins over
|
||||
`UnmarshalTOML` when a type implements both, so a long custom decode can
|
||||
abort on cancellation; a non-cancellable entry point hands in
|
||||
`context.Background`, never nil.
|
||||
- A TOML array decodes into a Go fixed-size array, `[N]T`, where only a slice
|
||||
was accepted before; the encoder could already encode one. A length mismatch
|
||||
is an error wrapped with the key path.
|
||||
|
||||
Reference in New Issue
Block a user