Closed mark-adams closed 8 years ago
checkout my repo, I wrote something for my project becouse I need this functionality, you can use it if you want https://github.com/krhubert/envconf
Thanks @krhubert! Hopefully @kelseyhightower will merge my PR here as well.
Currently, environment variables can only be populated from basic primitives (int, float, string, bool, etc.). It'd be really useful if a user could take a comma-separated value given via an environment variable and populate it into a slice field on a struct.
For example, given the following struct:
a user should be able to set
ADMINUSERS = "john,joe,matt"
in the environment and have the values populated into theSpecification.AdminUsers
field on the above struct as[]string{"john", "joe", "matt"}