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
I can easily access this in code with people.0.name for example. I can even access this in env vars if I do cfg.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) and then set PEOPLE_0_NAME=jason.
But how do I bind a flag to it? I imagine this would be something like --people.0.name jerome and --people.0.age 22 but I'm not sure if pflag supports this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
So I have this config file:
I can easily access this in code with
people.0.name
for example. I can even access this in env vars if I docfg.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
and then setPEOPLE_0_NAME=jason
.But how do I bind a flag to it? I imagine this would be something like
--people.0.name jerome
and--people.0.age 22
but I'm not sure if pflag supports this.Beta Was this translation helpful? Give feedback.
All reactions