pelletier / go-toml

Go library for the TOML file format
https://github.com/pelletier/go-toml
Other
1.67k stars 208 forks source link

Decode: fix reuse of slice for array tables #934

Closed pelletier closed 4 months ago

pelletier commented 4 months ago

When decoding into a non-empty slice, it needs to be emptied so that only the tables contained in the document are present in the resulting value.

Arrays are not impacted because their unmarshal offset is tracked separately.

Fixes https://github.com/pelletier/go-toml/issues/931