go-akka / configuration

typesafe HOCON
Apache License 2.0
81 stars 36 forks source link

toMap method #2

Open bsideup opened 7 years ago

bsideup commented 7 years ago

Hi!

Would be cool to support toMap() map[string]interface{} method to simplify JSON-to-HOCON code replacement in the apps.

i.e. I have an app where I use JSON as a configuration format, now I want to use HOCON. My old code was converting JSON string to map[string]interface{} and expected it as the result, so I want to replace only the parsing part.

Thanks!

xujinzheng commented 7 years ago

I think it's better to implement

Unmarshal(data []byte, v interface{}) error

then you can unmarshal config data into struct or map