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

[][]string from env #120

Open
mmavka opened this issue Mar 26, 2023 · 1 comment
Open

[][]string from env #120

mmavka opened this issue Mar 26, 2023 · 1 comment

Comments

@mmavka
Copy link

mmavka commented Mar 26, 2023

Hello. Thanks for the library.
I can't figure out how to pass through env [][]string.
Thank you.

type Config struct {
   Target [][]string `yaml:"target" env:"TARGET"`
}

From yaml work:

target:
  - ["key1","value1"]
  - ["key2","value2"]

How can I pass this through env?

@saddit
Copy link
Contributor

saddit commented Mar 29, 2023

Maybe you should use map[string]string and write it as the key-value format.

target:
  key1: value1
  key2: value2

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