Clean up debug code
This commit is contained in:
parent
afe269ec7d
commit
e9a29091fa
@ -5,7 +5,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
|
||||||
sqlmock "gopkg.in/DATA-DOG/go-sqlmock.v1"
|
sqlmock "gopkg.in/DATA-DOG/go-sqlmock.v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -19,7 +18,6 @@ type ExpectedExec interface {
|
|||||||
|
|
||||||
// SqlmockQuery implements Query for asserter go-sqlmock
|
// SqlmockQuery implements Query for asserter go-sqlmock
|
||||||
type SqlmockQuery struct {
|
type SqlmockQuery struct {
|
||||||
scope *Scope
|
|
||||||
query *sqlmock.ExpectedQuery
|
query *sqlmock.ExpectedQuery
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,6 +33,7 @@ func getRowForFields(fields []*Field) []driver.Value {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check if we have a zero Value
|
// check if we have a zero Value
|
||||||
|
// just append nil if it's not valid, so sqlmock won't complain
|
||||||
if !value.IsValid() {
|
if !value.IsValid() {
|
||||||
values = append(values, nil)
|
values = append(values, nil)
|
||||||
continue
|
continue
|
||||||
@ -42,10 +41,6 @@ func getRowForFields(fields []*Field) []driver.Value {
|
|||||||
|
|
||||||
concreteVal := value.Interface()
|
concreteVal := value.Interface()
|
||||||
|
|
||||||
// if we already have a driver.Value, just append
|
|
||||||
_, isValuer := concreteVal.(driver.Valuer)
|
|
||||||
spew.Printf("%s: %v\r\n", field.DBName, isValuer)
|
|
||||||
|
|
||||||
if driver.IsValue(concreteVal) {
|
if driver.IsValue(concreteVal) {
|
||||||
values = append(values, concreteVal)
|
values = append(values, concreteVal)
|
||||||
} else if valuer, ok := concreteVal.(driver.Valuer); ok {
|
} else if valuer, ok := concreteVal.(driver.Valuer); ok {
|
||||||
@ -91,9 +86,6 @@ func (q *SqlmockQuery) getRowsForOutType(out interface{}) *sqlmock.Rows {
|
|||||||
panic(fmt.Errorf("Can only get rows for slice or struct"))
|
panic(fmt.Errorf("Can only get rows for slice or struct"))
|
||||||
}
|
}
|
||||||
|
|
||||||
spew.Dump(columns)
|
|
||||||
spew.Dump(rows)
|
|
||||||
|
|
||||||
return rows
|
return rows
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -105,7 +97,6 @@ func (q *SqlmockQuery) Returns(out interface{}) ExpectedQuery {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SqlmockExec struct {
|
type SqlmockExec struct {
|
||||||
scope *Scope
|
|
||||||
exec *sqlmock.ExpectedExec
|
exec *sqlmock.ExpectedExec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user