Gofakeit offers hundreds of functions to generate names, addresses, structs, files, and templates. It includes an HTTP server, CLI, and zero third-party dependencies.
Overview
Gofakeit is a Go library for producing plausible random test and seed data. Global and seeded random sources support reproducible outputs when needed.
Struct generation fills Go types using tags and custom Fakeable interfaces for fields that need special handling. Template functions render custom strings with embedded generator calls.
Auxiliary packages provide a command-line tool and HTTP server for remote fake data generation. Utilities also emit CSV, JSON, or XML files from structs.
Developers can register custom function lookups to extend generation for domain-specific fixtures across tests and demos.
Key features
- 310 plus generator functions
- Struct and tag generation
- Custom template engine
- HTTP server mode
- Command-line tool
- Seeded random output
- Custom function lookups
- Zero dependencies
Use cases
- Go test fixtures
- Database seed data
- API mock responses
- Benchmark sample records