Go (Golang) Fake Data Generator for Struct, previously https://github.com/bxcodec/faker
See the codeStruct 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/go-faker/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 For :
int, int8, int16, int32 & int64uint, uint8, uint16, uint32 & uint64boolstringfloat32, float64slice / array of any typemap of any key/value of supported typesStructTypeProvider & implementing your own generator function. This can be used for redefined time, big.Rat, etc. See example for usage.
time.Time provider is registered, you can override it by registering your own provider.Unfortunately this library has some limitation
faker:"-" on your private fields.any (empty interface) data type. How could we generate anything without knowing its data type?map[any]any, map[T]any & map[any]T data types (where T is any concrete type). Once again, we cannot generate values for an unknown data type.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.template tag currently only supports string, named string types & *string, and can only reference the fields of the struct that declares it. 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
654 followers · starred Nov 2025
85 followers · starred Mar 2024
296 followers · starred Oct 2025
79 followers · starred Feb 2025
Go (Golang) Fake Data Generator for Struct, previously https://github.com/bxcodec/faker
See the codeStruct 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/go-faker/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 For :
int, int8, int16, int32 & int64uint, uint8, uint16, uint32 & uint64boolstringfloat32, float64slice / array of any typemap of any key/value of supported typesStructTypeProvider & implementing your own generator function. This can be used for redefined time, big.Rat, etc. See example for usage.
time.Time provider is registered, you can override it by registering your own provider.Unfortunately this library has some limitation
faker:"-" on your private fields.any (empty interface) data type. How could we generate anything without knowing its data type?map[any]any, map[T]any & map[any]T data types (where T is any concrete type). Once again, we cannot generate values for an unknown data type.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.template tag currently only supports string, named string types & *string, and can only reference the fields of the struct that declares it. 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
654 followers · starred Nov 2025
85 followers · starred Mar 2024
296 followers · starred Oct 2025
79 followers · starred Feb 2025