koding / multiconfig

Load configuration from multiple sources in Go
http://godoc.org/github.com/koding/multiconfig
MIT License
454 stars 64 forks source link

include field name in unsupported type error message #27

Closed ickymettle closed 9 years ago

ickymettle commented 9 years ago

I was retrofitting multiconfig into an existing project today and run up against a few unsupported types. I was finding that error messages such as:

multiconfig: not supported type: int64

This left me scratching my head on what field was failing (it was indirectly an int64, a time.Duration).

This patch adds the failing field name to the error message, which produces messages such as:

multiconfig: field 'UploadInterval' has unsupported type: int64

Thanks for a great library!

cihangir commented 9 years ago

Thanks @ickymettle !

fatih commented 9 years ago

We eventually should add more supported types. There is also the issue #26 because of this.