This checks if the tag contains the word len, its contents is split by using an equal sign as separator.
It throws an error if this fails.
In our specific case we use a oneof in our tag. One of the possible options is 'Bedrijfsmatig handelen'.
This text contains the word len so faker thinks this must be something like len=10, but it's not.
So our unit tests and app fail.
Note also the word 'lang' could be part of a oneof, so should also be mitigated.
I think extending the checks with && !isOneOfTag could work.
Hi,
I found a bug in faker.go.
In function
extractStringFromTag
there is the following code:This checks if the tag contains the word
len
, its contents is split by using an equal sign as separator. It throws an error if this fails. In our specific case we use a oneof in our tag. One of the possible options is 'Bedrijfsmatig handelen'. This text contains the wordlen
so faker thinks this must be something likelen=10
, but it's not. So our unit tests and app fail.Note also the word 'lang' could be part of a oneof, so should also be mitigated. I think extending the checks with && !isOneOfTag could work.
Could you please have a look at it?
Regards, Ton