faker icon indicating copy to clipboard operation
faker copied to clipboard

Oneof don't work with *int

Open eduardo-mior opened this issue 4 years ago • 3 comments

I have a struct with *int and I'm trying to use faker:"oneof: 1, 2" but I always get unsupported Tag: oneof: 1, 2 when trying to generate the fakes data.

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

I'm using v3.6.0 and getting the same issue when trying to use oneof for a boolean as in faker:"oneof: true, false" which returns this error: Tag unsupported: oneof: true, false

jonfulk avatar May 13 '21 20:05 jonfulk

@eduardo-mior ~~I was able to resolve this by importing "github.com/bxcodec/faker/v3". I thought I was using v3.6.0, but it turns out that "github.com/bxcodec/faker" was reverting to v2. I had to remove all references to "github.com/bxcodec/faker" and do go mod tidy to get everything updated.~~

Spoke too soon... tests pass still, but faker is still throwing the error even after updating to v3.6.0, which I'm definitely using now. Sorry for the confusion.

jonfulk avatar May 14 '21 13:05 jonfulk

Thanks @eduardo-mior for the reports. I'll take a look soon when I free. Meanwhile, if you're free, can help to raise a PR?

Just ping me in @bxcodec (twitter) once you've raised a PR so I can merge and release a new version

bxcodec avatar Jul 01 '21 04:07 bxcodec