Repolode
brianvoe

brianvoe/gofakeit

A Go library that generates random fake data such as names, addresses, emails, companies, and structured files for testing and seeding.

Stars
5,414
Forks
297
Open issues
6
Last commit
8 days ago

What is it?

Gofakeit is a Go library for generating random fake data. It provides more than 300 functions covering people, addresses, internet fields, companies, payments, dates, colors, emoji, and more, and can also produce CSV, JSON, XML, SQL, and Markdown output.

Beyond individual function calls, the library can fill Go structs automatically using struct tags, including regex-based and template-style values. Output can be made reproducible with a seed, and custom generators can be registered through AddFuncLookup. Random sources such as PCG, ChaCha8, and crypto/rand are selectable.

The project has zero external dependencies and includes an HTTP server and a command-line tool as sub-packages.

Key features

  • 01Over 300 generators for names, addresses, internet data, companies, payments, and dates
  • 02Fills Go structs automatically through fake struct tags
  • 03Produces CSV, JSON, XML, SQL, and Markdown output
  • 04Reproducible results via Seed and selectable random sources
  • 05Custom generator functions can be registered with AddFuncLookup
  • 06Zero external dependencies

Use cases

  • Seeding test databases with realistic-looking records
  • Filling Go struct fixtures in unit and integration tests
  • Generating sample JSON or CSV files for demos and prototypes
  • Producing anonymized placeholder data for UI mockups

Quick start

  1. 1

    Install the library with go get

    go get github.com/brianvoe/gofakeit/v7
  2. 2

    Import the package and call functions such as gofakeit.Name() in your Go code

In collections

Topics

FAQ

What is gofakeit?
A Go library that generates random fake data such as names, addresses, emails, companies, and structured files for testing and seeding. Gofakeit is a Go library for generating random fake data. It provides more than 300 functions covering people, addresses, internet fields, companies, payments, dates, colors, emoji, and more, and can also produce CSV, JSON, XML, SQL, and Markdown output.
Is gofakeit free to use? What license does it have?
gofakeit is open source under the MIT license. Check the license terms before using it in commercial products.
Is gofakeit still maintained?
Actively maintained. The last commit to gofakeit was on Oct 29, 2026.
What can I use gofakeit for?
Seeding test databases with realistic-looking records Filling Go struct fixtures in unit and integration tests Generating sample JSON or CSV files for demos and prototypes Producing anonymized placeholder data for UI mockups
How do I install gofakeit?
Install the library with go get: go get github.com/brianvoe/gofakeit/v7 Import the package and call functions such as gofakeit.Name() in your Go code
Where can I get gofakeit?
The source code and installation instructions are on GitHub: https://github.com/brianvoe/gofakeit

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects