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

[Feature] Get slice values from different env keys #116

Open
vejed opened this issue Nov 8, 2024 · 1 comment
Open

[Feature] Get slice values from different env keys #116

vejed opened this issue Nov 8, 2024 · 1 comment

Comments

@vejed
Copy link

vejed commented Nov 8, 2024

Add iteratesuffix configuration param for decoding slice from separate env values

Example:

type MyStruct struct {
  MyVar []string `env:"MYVAR, iteratesuffix"`
}
export MYVAR0="a"
export MYVAR1="b"
export MYVAR2="c"
export MYVAR3="d"

will substitute values to slice as

MyStruct {
  MyVar: []string{"a", "b", "c", "d"},
}
@sethvargo
Copy link
Owner

Why? What's the use case?

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

2 participants