You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this just a bug - or is there a reason why the root level is skipped on purpose?
In case of the former I could probably try to come up with a PR as well 😄
The text was updated successfully, but these errors were encountered:
File sources
Lookup
, or more specifically thenestedVal
func inaltsrc.go
only works if values are nested at least one level deep.For example, assume the following TOML file:
trying to use it like this only works for
database.url
, but not thehost
:will print the following (host is empty)
The workaround for now would be to wrap all root elements inside of a dummy container, e.g.
app.host
instead of justhost
.But of course it would be better if this could be adressed directly by the
altsrc
library.Either by not using
nestedVal
here in case there is no dot in the key:https://github.com/urfave/cli-altsrc/blob/main/toml/toml_value_source.go#L40
or by updating it to also support the root level:
https://github.com/urfave/cli-altsrc/blob/main/altsrc.go#L48
Is this just a bug - or is there a reason why the root level is skipped on purpose?
In case of the former I could probably try to come up with a PR as well 😄
The text was updated successfully, but these errors were encountered: