faker icon indicating copy to clipboard operation
faker copied to clipboard

Compatible with interface{}

Open c625473164 opened this issue 5 years ago • 2 comments

If meet some fields which not supported such as interface{}, Can we just ignore the err. For example

struct Test{
A  int
B string
C interface{}
}

I only want A, B filed, just give me C with a nil value

c625473164 avatar Mar 28 '19 07:03 c625473164

I don't think it's will be good. If you want to ignore the interface, maybe you can add the skip tag.

struct Test{
A  int
B string
C interface{} `faker:"-"`
}

bxcodec avatar Mar 28 '19 07:03 bxcodec

the struct is sometimes generated by thrift or other tools such as protobuf, so it's not so convenient to add tags

c625473164 avatar Mar 28 '19 09:03 c625473164