pelletier / go-toml

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

marshaler: flatt anonymous structs #738

Closed j-licht closed 2 years ago

j-licht commented 2 years ago

rebuild behavior of handling anonymous structs like in v1. Also copied the both tests from v1. Without this patch unmarshaling of a marshaled struct with anonymous structs isn't possible.

pelletier commented 2 years ago

Hi! Closing this in favor of https://github.com/pelletier/go-toml/pull/747. You are correct that the current behavior of never flattening is wrong, but there is a bit more subtlety to it. Let me know if it works for you!