Install gofakeitserver
masterInstall the gofakeitserver CLI tool using the following Go command:
go get -u github.com/brianvoe/gofakeit/v7/cmd/gofakeitserverrepository·master·Indexed 26 days ago
https://github.com/brianvoe/gofakeitA random data generator for Go providing over 310 functions to generate realistic fake data for testing and development. It includes a CLI tool, an HTTP server (gofakeitserver), and support for populating structs via tags, implementing the Fakeable interface, and using Go's text/template engine. The library supports various data categories including person, address, internet, financial, and more, and allows for custom random sources and deterministic seeding.
Install the gofakeitserver CLI tool using the following Go command:
go get -u github.com/brianvoe/gofakeit/v7/cmd/gofakeitserverStart the gofakeitserver on its default port (8080) by running the command in your terminal. Once running, all gofakeit functions are accessible via HTTP. Use the lowercase function name as the first path segment, and pass any required arguments as query parameters.
gofakeitserver // default port is 8080Install the gofakeit command line tool using go install from the v7 repository.
go install -v github.com/brianvoe/gofakeit/v7/cmd/gofakeit@latest-loop flag to output a specific function multiple times.Install the gofakeit library using the standard Go get command.
go get github.com/brianvoe/gofakeit/v7To use these random number generators in your Go project, import the package using the following path:
import "github.com/yourusername/randsource"The gofakeit CLI allows you to generate fake data directly from your terminal. You can call specific data functions, list available categories, or generate multiple outputs using the generate command with a loop flag.
lastname).generate command followed by the function name and the -loop flag.list to see top-level categories (like person, word, address) or list <category> to see specific sub-functions.help to view the command synopsis and description.The gofakeit library provides a suite of functions to generate random Minecraft-themed strings. You can use the package-level functions (which use GlobalFaker) or call methods on a specific *Faker instance for controlled randomness.
Available categories include:
You can call global functions directly from the gofakeit package to generate various types of random data such as names, emails, phone numbers, and more.
import "github.com/brianvoe/gofakeit/v7"
gofakeit.Name() // Markus Moen
gofakeit.Email() // alaynawuckert@kozey.biz
gofakeit.Phone() // (570)245-7485
gofakeit.BS() // front-end
gofakeit.BeerName() // Duvel
gofakeit.Color() // MediumOrchid
gofakeit.Company() // Moen, Pagac and Wuckert
gofakeit.CreditCardNumber(nil) // 4287271570245748
gofakeit.HackerPhrase() // Connecting the array won't do anything, we need to generate the haptic COM driver!
gofakeit.JobTitle() // Director
gofakeit.CurrencyShort() // USDThe Crypto source utilizes Go's crypto/rand package. Use this source for security-sensitive applications that require cryptographically secure random numbers.
source := NewCryptoSource()
number := source.Uint64()Generate physical addresses, city, country, and geographic coordinates.
Address() *AddressInfo
City() string
Country() string
State() string
Street() string
Zip() string
Latitude() float64
Longitude() float64The Dumb source is a deterministic generator designed for testing environments. It provides predictable output, which is useful when consistent results are more important than high-quality randomness.
source := NewDumb(seed)
number := source.Uint64()