Closed
Description
given this struct
type MyStruct struct {
A string
B map[string]any
}
the following code will fail
var base MyStruct
err := faker.FakeData(&base)
with an error:
interface{} not allowed
(this is how I would expect it to behave)
if I try to ignore the fields that include an interface:
var base MyStruct
err := faker.FakeData(&base,
options.WithIgnoreInterface(true),
)
I would expect the faking to work, and leave the B
field empty,
but the code will panic with
panic: runtime error: invalid memory address or nil pointer dereference
adding
options.WithFieldsToIgnore("B")
will solve that problem, but the panic is very confusing,
and there is no hint of what is the problem
Metadata
Metadata
Assignees
Labels
No labels