faker icon indicating copy to clipboard operation
faker copied to clipboard

Support enumeration?

Open BPing opened this issue 4 years ago • 2 comments

BPing avatar Oct 09 '20 09:10 BPing

Hmmm,

do you have any use case scenario for this?

bxcodec avatar Oct 09 '20 09:10 bxcodec

Use oneof tag. Example:

type TestStruct struct {
    MyEnum         int `faker:"oneof: 1, 2, 3, 4"`
    MyOtherEnum string `faker:"oneof: YELLOW, BLUE, GREEN, RED"`
}

eduardo-mior avatar Apr 26 '21 18:04 eduardo-mior