kelseyhightower / envconfig

Golang library for managing configuration data from environment variables
MIT License
5.02k stars 377 forks source link

Handle Set method (like flag.Value). #48

Closed extemporalgenome closed 8 years ago

extemporalgenome commented 8 years ago

This allows values with the necessary methods for custom flag parsing to work out-of-the-box with envconfig. To retain reasonable backwards compatibility, Decoder takes precedence over Setter.

teepark commented 8 years ago

@extemporalgenome thanks for this! Brilliant, making the interface a subset of flag.Value. Wish I had done it that way the first time so backwards compatibility wouldn't be an issue.

Just one little tweak in the code (commented inline) and then it'd be great to have a note about this in the README.

teepark commented 8 years ago

@extemporalgenome this is merged, thank you!