go-faker / faker

Go (Golang) Fake Data Generator for Struct, previously https://github.com/bxcodec/faker
https://pkg.go.dev/github.com/go-faker/faker/v4
MIT License
614 stars 30 forks source link

feat: v3 functionality from bxcodec/faker #6

Closed bxcodec closed 1 year ago

bxcodec commented 1 year ago

fix #5

bxcodec commented 1 year ago

@wolf-joe can you help to re-review? I missed this when porting from the old repo.

Also the test about the TestRandomMaxMinMapSliceSize is not stable. Sometimes I got this error <> due to the randomized result. Can you help to fix take a look on this? It's related to bxcodec/faker#173


=== Failed
=== FAIL: . TestRandomMaxMinMapSliceSize (0.00s)
    faker_test.go:2246: map (len:2) not expect length with test case {max:2 min:3 expect:3}

DONE 123 tests, 1 failure in 0.512s
make: *** [Makefile:33: run-tests] Error 1
wolf-joe commented 1 year ago

@wolf-joe can you help to re-review? I missed this when porting from the old repo.

Also the test about the TestRandomMaxMinMapSliceSize is not stable. Sometimes I got this error <> due to the randomized result. Can you help to fix take a look on this? It's related to bxcodec/faker#173


=== Failed
=== FAIL: . TestRandomMaxMinMapSliceSize (0.00s)
    faker_test.go:2246: map (len:2) not expect length with test case {max:2 min:3 expect:3}

DONE 123 tests, 1 failure in 0.512s
make: *** [Makefile:33: run-tests] Error 1

getFakedValue may generate a map with duplicated key, so the real length may be smaller than expected. it's a little tricky

bxcodec commented 1 year ago

@wolf-joe any idea how to solve that?

wolf-joe commented 1 year ago

@wolf-joe any idea how to solve that?

Noop for now