Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: squash with prefix #288

Open
kamilsk opened this issue May 26, 2022 · 0 comments
Open

feat: squash with prefix #288

kamilsk opened this issue May 26, 2022 · 0 comments

Comments

@kamilsk
Copy link

kamilsk commented May 26, 2022

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.

kamilsk added a commit to kamilsk/mapstructure that referenced this issue May 31, 2022
kamilsk added a commit to kamilsk/mapstructure that referenced this issue May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant