Open kamilsk opened 2 years ago
Hi! What do you think about the possibility of adding prefix support while squashing structs?
Example:
type Bitbucket struct { Token config.Secret `mapstructure:"token"` } type GitHub struct { Token config.Secret `mapstructure:"token"` } type Service struct { Bitbucket `mapstructure:"bitbucket,squash"` GitHub `mapstructure:"github,prefix"` }
BITBUCKET_TOKEN=secret GITHUB_TOKEN=secret
Now, I'm using the following workaround https://github.com/octomation/maintainer/blob/af46d826f7c070347b26fa46efee6dbdee4f8be3/internal/config/tool.go#L53-L64 but want to contribute to mapstructure the possibility to add prefix if squash it has.
squash
Hi! What do you think about the possibility of adding prefix support while squashing structs?
Example:
Now, I'm using the following workaround https://github.com/octomation/maintainer/blob/af46d826f7c070347b26fa46efee6dbdee4f8be3/internal/config/tool.go#L53-L64 but want to contribute to mapstructure the possibility to add prefix if
squash
it has.