Removed null for null-extended

* Fixed broken RandomizeStruct test
This commit is contained in:
Patrick O'brien 2016-06-07 16:42:19 +10:00
parent 37a333f6ff
commit 8a7926664c
3 changed files with 8 additions and 9 deletions

View file

@ -5,7 +5,7 @@ import (
"testing"
"time"
"github.com/guregu/null"
"gopkg.in/BlackBaronsTux/null-extended.v1"
)
type testObj struct {

View file

@ -304,7 +304,6 @@ func randomizeField(field reflect.Value) error {
return fmt.Errorf("unsupported type: %T", typ.String())
}
}
field.Set(reflect.ValueOf(newVal))
return nil

View file

@ -4,7 +4,7 @@ import (
"testing"
"time"
"github.com/guregu/null"
"gopkg.in/BlackBaronsTux/null-extended.v1"
)
func TestBind(t *testing.T) {
@ -135,11 +135,11 @@ func TestRandomizeStruct(t *testing.T) {
Ignore int
NullInt null.Int
NullFloat null.Float
NullBool null.Bool
NullString null.String
NullTime null.Time
NullInt null.Int
NullFloat64 null.Float64
NullBool null.Bool
NullString null.String
NullTime null.Time
}{}
err := RandomizeStruct(&testStruct, "Ignore")
@ -162,7 +162,7 @@ func TestRandomizeStruct(t *testing.T) {
}
if testStruct.NullInt.Valid == false &&
testStruct.NullFloat.Valid == false &&
testStruct.NullFloat64.Valid == false &&
testStruct.NullBool.Valid == false &&
testStruct.NullString.Valid == false &&
testStruct.NullTime.Valid == false {