Remove duplicate code

This commit is contained in:
Dan Sosedoff 2016-01-04 18:35:05 -06:00
parent 1f99576a37
commit c7e58f0828

View File

@ -60,16 +60,6 @@ func (res *Result) CSV() []byte {
}
func (res *Result) JSON() []byte {
records := []map[string]interface{}{}
for _, row := range res.Rows {
record := map[string]interface{}{}
for i, col := range res.Columns {
record[col] = row[i]
}
records = append(records, record)
}
data, _ := json.Marshal(records)
data, _ := json.Marshal(res.Format())
return data
}