Skip to content

Commit

Permalink
improve (data *Dataset) RecordsString
Browse files Browse the repository at this point in the history
  • Loading branch information
flarco committed Sep 1, 2024
1 parent ebb8896 commit 3830208
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/dbio/iop/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,17 +366,17 @@ func (data *Dataset) Records(lower ...bool) []map[string]interface{} {
}

// RecordsString return rows of maps or string values
func (data *Dataset) RecordsString(lower ...bool) []map[string]interface{} {
func (data *Dataset) RecordsString(lower ...bool) []map[string]string {
Lower := true
if len(lower) > 0 {
Lower = lower[0]
}
records := make([]map[string]interface{}, len(data.Rows))
records := make([]map[string]string, len(data.Rows))
for i, row := range data.Rows {
rec := map[string]interface{}{}
rec := map[string]string{}
for j, field := range data.GetFields(Lower) {
if row[j] == nil {
rec[field] = nil
rec[field] = ""
} else {
rec[field] = cast.ToString(row[j])
}
Expand Down

0 comments on commit 3830208

Please sign in to comment.