pelletier / go-toml

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

Support for passing values using enviorment variables #797

Closed josepowera closed 2 years ago

josepowera commented 2 years ago

Allow TOML to read some variables not from TOML file - but from using Enviorment variables. Similar to https://docs.influxdata.com/telegraf/v1.21/administration/configuration/#set-environment-variables or https://github.com/spf13/viper#working-with-environment-variables

This makes configurations in kubernetes enviorments much more easy.

pelletier commented 2 years ago

I believe interpolating environment variables in string values is outside the scope of go-toml. This can be accomplished outside of the library in various ways depending on what you need. Adding this feature to go-toml would increase the maintenance cost for no clear benefit.