Go (Golang) Fake Data Generator for Struct. [Notes]This repository is archived, moved to the new repository https://github.com/go-faker/faker
See the codeThis 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/v4

Bench 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/op
The 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.
Overall
Maintained
Code review
Go module
Latest release
Releases this year
425 followers · starred Mar 2021
45 followers · starred Jan 2019
93 followers · starred Feb 2020
65 followers · starred Mar 2024
Go (Golang) Fake Data Generator for Struct. [Notes]This repository is archived, moved to the new repository https://github.com/go-faker/faker
See the codeThis 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/v4

Bench 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/op
The 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.
Overall
Maintained
Code review
Go module
Latest release
Releases this year
425 followers · starred Mar 2021
45 followers · starred Jan 2019
93 followers · starred Feb 2020
65 followers · starred Mar 2024