goFaker is a Go library that generates fake data for you.
It's heavily inspired by FakerPHP
go get https://github.com/harmlessprince/goFaker
Add this import line to the file you're working in:
import "github.com/harmlessprince/goFaker"
Use goFaker.MakeFactory() to create and initialize a faker generator, which can generate data by calling methods named after the type of data you want.
// use the factory to create a Faker\Generator instance
generator := goFaker.MakeFactory()
// generate data by calling methods
fmt.Println(generator.Date("", "2020-08-10 15:04:05")) //1991-08-11
fmt.Println(generator.BloodType()) // 0
fmt.Println(generator.PhoneNumber()) // 729-988-596
fmt.Println(generator.Address()) // 67 Ville a 96812 ClantonVille
fmt.Println(generator.CountryCode()) // LU
goFaker.MakeFactory() can take a locale as an argument, to return localized data. If no localized provider is found, the factory falls back to the default data.
locality := "en_NG"
generator := goFaker.MakeFactory(locality)
fmt.Println(generator.Date("", "2020-08-10 15:04:05")) // 1991-08-11
fmt.Println(generator.BloodType()) // 0
fmt.Println(generator.PhoneNumber()) // +234 905 352 8428
fmt.Println(generator.PostCode()) // 41 865
fmt.Println(generator.CountryCode()) // LU
fmt.Println(generator.Name()) // Titilayo Ebiere Olaoluwa