Assisted-by: DeepSeek V4.1 Flash
This commit is contained in:
+11
-1
@@ -9,7 +9,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
### Added
|
||||
|
||||
-
|
||||
- `encoding.TextMarshaler` and `encoding.TextUnmarshaler` are honoured by
|
||||
default, with no option to switch them off. A type that implements them is
|
||||
encoded as a TOML string and decoded from one: `net.IP` becomes
|
||||
`"192.0.2.1"`, and a user type with `MarshalText` or `UnmarshalText` follows.
|
||||
`MarshalTOML` and `UnmarshalTOML` still win over the text methods, and the
|
||||
four date-time types keep their bare timestamp form instead of becoming a
|
||||
quoted string. A struct type that implements the interface now encodes as a
|
||||
string where it was a table before, which is the breaking part of the change.
|
||||
- `time.Duration` is encoded in its canonical Go form as a TOML string,
|
||||
`1h30m0s`, because TOML has no duration type; the decoder reads that string
|
||||
back and still accepts a bare integer as the nanosecond count.
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
Reference in New Issue
Block a user