magiconair / properties

Java properties scanner for Go
BSD 2-Clause "Simplified" License
323 stars 77 forks source link

decode into map[string]interface{} #51

Open fugkco opened 3 years ago

fugkco commented 3 years ago

Hello, would be possible to add support to decode into map[string]interface{}. I need to decode a properties file into a generic interface{} but below code is returning an error. Is there a reason to only allow it to be a struct?

    if t.Kind() != reflect.Ptr || v.Elem().Type().Kind() != reflect.Struct {
        return fmt.Errorf("not a pointer to struct: %s", t)
    }