Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Oneof don't work with *int #136

Open
eduardo-mior opened this issue Apr 26, 2021 · 3 comments
Open

Oneof don't work with *int #136

eduardo-mior opened this issue Apr 26, 2021 · 3 comments

Comments

@eduardo-mior
Copy link

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.

@jonfulk
Copy link

jonfulk commented May 13, 2021

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
Copy link

jonfulk commented May 14, 2021

@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.

@bxcodec
Copy link
Owner

bxcodec commented Jul 1, 2021

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants