Go (Golang) Fake Data Generator for Struct. [Notes]This repository is archived, moved to the new repository https://github.com/go-faker/faker
Go (Golang) Fake Data Generator for Struct. [Notes]This repository is archived, moved to the new repository https://github.com/go-faker/faker
This repository has been archived, and moved to the new repository here https://github.com/go-faker/faker Further development and fixing will be happening in the new repository.
Struct Data Fake Generator
Faker will generate you a fake data based on your Struct.
You can file an Issue. See documentation in Go.Dev
go get -u github.com/bxcodec/faker/v4Bench To Generate Fake Data
BenchmarkFakerDataNOTTagged-4 500000 3049 ns/op 488 B/op 20 allocs/op BenchmarkFakerDataTagged-4 100000 17470 ns/op 380 B/op 26 allocs/opThe Struct Field must be PUBLIC.
Support Only For :
int, int8, int16, int32 & int64[]int, []int8, []int16, []int32 & []int64bool & []boolstring & []stringfloat32, float64, []float32 &[]float64time.Time & []time.TimeUnfortunately this library has some limitation
faker:"-" on your private fields.interface{} data type. How could we generate anything without knowing its data type?map[interface{}]interface{}, map[any_type]interface{} & map[interface{}]any_type data types. Once again, we cannot generate values for an unknown data type.faker, it's safer not to use any custom types in order to avoid panics.oneof tag currently only supports string, the int types, and both float32 & float64. Further support is coming soon (i.e. hex numbers, etc). See example for usage.To contrib to this project, you can open a PR or an issue.
No open issues yet, or sync has not completed.