properties icon indicating copy to clipboard operation
properties copied to clipboard

decode into map[string]interface{}

Open fugkco opened this issue 4 years ago • 0 comments

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)
	}

fugkco avatar Jan 17 '21 19:01 fugkco