diff --git a/dbtool/dbtool.go b/dbtool/dbtool.go index 5251364..28720da 100644 --- a/dbtool/dbtool.go +++ b/dbtool/dbtool.go @@ -25,6 +25,7 @@ func ScanToStruct(rows *sql.Rows, ss interface{}) (ok bool, err error) { return true, nil } +// ScanToStructAll - func ScanToStructAll(rows *sql.Rows, ss interface{}) error { sliceVal := reflect.Indirect(reflect.ValueOf(ss)) if sliceVal.Kind() != reflect.Slice { @@ -53,6 +54,7 @@ func ScanToStructAll(rows *sql.Rows, ss interface{}) error { return nil } +// ResultToMap - func ResultToMap(r *sql.Rows) ([]map[string]interface{}, error) { result := make([]map[string]interface{}, 0) cols, err := r.Columns() @@ -82,6 +84,7 @@ func ResultToMap(r *sql.Rows) ([]map[string]interface{}, error) { return result, nil } +// MapToStruct - func MapToStruct(data map[string]interface{}, out interface{}) error { ss := reflect.ValueOf(out).Elem() for i := 0; i < ss.NumField(); i++ {