ilyakaznacheev / cleanenv

✨Clean and minimalistic environment configuration reader for Golang
MIT License
1.61k stars 111 forks source link

[][]string from env #120

Open mmavka opened 1 year ago

mmavka commented 1 year ago

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 commented 1 year ago

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

target:
  key1: value1
  key2: value2