Open CaledoniaProject opened 9 months ago
Hi there,
I'm wondering why encoding/json could work with []interface{} but not gocsv, can you explain why won't you implement that?
I had to do a lot a reflect job to fix this, it looks very much unnecessary to me, e.g
func DoEncode(tx *gorm.DB, resultModel interface{}, query string) { var ( result = reflect.New(resultType).Interface() ) // use gorm to fill result repeatly ... tx.ScanRows(rows, result) ... resultSlice := reflect.MakeSlice(reflect.SliceOf(resultType), 1, 1) resultSlice = reflect.Append(resultSlice, reflect.ValueOf(result).Elem()) data, err := gocsv.MarshalString(resultSlice.Interface()) }
Hi there,
I'm wondering why encoding/json could work with []interface{} but not gocsv, can you explain why won't you implement that?
I had to do a lot a reflect job to fix this, it looks very much unnecessary to me, e.g