naoina / toml

TOML parser and encoder library for Golang
MIT License
294 stars 50 forks source link

Ignore additional fields #5

Closed mbertschler closed 7 years ago

mbertschler commented 9 years ago

My usecase is having a config file for multiple projects, and one project only uses a part of the structure of the full config file. The problem is that Unmarshal() fails if there are fields in the config file that are not defined in my struct.

Could this library ignore fields from the file that are not available in the target struct like (this is how for example encoding/json would handle this)?

Thanks

naoina commented 9 years ago

It can't do that. However, I might change to that behavior in future.