Gofakeit is a random fake data generator written in Go.
The tool addresses the need for generating realistic test data during development and testing. It provides over three hundred functions covering common data types like names, addresses, emails, phone numbers, and dates. Users can seed the generator for reproducible output or rely on cryptographically secure seeding by default. The tool supports multiple random sources, including the default math/rand/v2 PCG generator, and allows switching to alternatives like crypto/rand through a global rand set mechanism.
Gofakeit suits projects that need synthetic data for testing without external dependencies. It works well for unit tests, integration tests, and populating databases with realistic values. The tool can generate data for entire structs through automatic field population, with support for struct tags to control generation behavior for specific fields. For cases where struct modification is not possible, the Fakeable interface allows custom generation logic. The project also includes a command-line tool and HTTP server for generating data outside of Go code, and supports Go's template engine for custom output formatting.
The project maintains active development with regular updates to its function library and testing infrastructure. The codebase includes comprehensive benchmarks to track performance characteristics. The tool has zero external dependencies, keeping it lightweight for integration into other projects. Custom functions can be registered through AddFuncLookup, allowing extension of both the core library and the command-line and server interfaces.