struct name revert
This commit is contained in:
6
lazy.go
6
lazy.go
@@ -32,7 +32,7 @@ type RowMock struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// configuration for RandomGenerate
|
// configuration for RandomGenerate
|
||||||
type RowConfig struct {
|
type Config struct {
|
||||||
Query string
|
Query string
|
||||||
Example any
|
Example any
|
||||||
Keys []any
|
Keys []any
|
||||||
@@ -47,7 +47,7 @@ type StructMock struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// generates mock data based on configuration to be used for sqlmock
|
// generates mock data based on configuration to be used for sqlmock
|
||||||
func RandomRows(m RowConfig) (*RowMock, error) {
|
func RandomRows(m Config) (*RowMock, error) {
|
||||||
//example struct cannot be nil and must be a struct
|
//example struct cannot be nil and must be a struct
|
||||||
if m.Example == nil {
|
if m.Example == nil {
|
||||||
return nil, ErrBadExample
|
return nil, ErrBadExample
|
||||||
@@ -113,7 +113,7 @@ func RandomRows(m RowConfig) (*RowMock, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func RandomStruct(c RowConfig) (*StructMock, error) {
|
func RandomStruct(c Config) (*StructMock, error) {
|
||||||
if c.Example == nil {
|
if c.Example == nil {
|
||||||
return nil, ErrBadExample
|
return nil, ErrBadExample
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user