no more index check
This commit is contained in:
7
lazy.go
7
lazy.go
@@ -114,6 +114,9 @@ func RandomRows(m Config) (*RowMock, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
// we are close to something here but the mock structs aren't it chief. Maybe the users can make() them first?
|
||||
// I don't love that either tho tbh
|
||||
// hmmmmm
|
||||
func RandomStruct(c Config) (*StructMock, error) {
|
||||
if c.Example == nil {
|
||||
return nil, ErrBadExample
|
||||
@@ -148,12 +151,12 @@ func RandomStruct(c Config) (*StructMock, error) {
|
||||
}
|
||||
|
||||
args[y] = nv
|
||||
if x == 0 {
|
||||
// if x == 0 {
|
||||
nf := filled.Index(x).Field(y)
|
||||
if nf.CanSet() {
|
||||
filled.Index(x).Field(y).Set(reflect.ValueOf(nv))
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user