gofakeit

package module
v6.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 24 Imported by: 507

README

alt text

Gofakeit Go Report Card Test GoDoc license

Random data generator written in go

ko-fi

Buy Me A Coffee

Features

Contributors

Thank you to all our Gofakeit contributors!

Installation

go get github.com/brianvoe/gofakeit/v6

Simple Usage

import "github.com/brianvoe/gofakeit/v6"

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() // 4287271570245748
gofakeit.HackerPhrase()     // Connecting the array won't do anything, we need to generate the haptic COM driver!
gofakeit.JobTitle()         // Director
gofakeit.CurrencyShort()    // USD

See full list of functions

Seed

If you are using the default global usage and dont care about seeding no need to set anything. Gofakeit will seed it with a cryptographically secure number.

If you need a reproducible outcome you can set it via the Seed function call. Every example in this repo sets it for testing purposes.

import "github.com/brianvoe/gofakeit/v6"

gofakeit.Seed(0) // If 0 will use crypto/rand to generate a number

// or

gofakeit.Seed(8675309) // Set it to whatever number you want

Random Sources

Gofakeit has a few rand sources, by default it uses math.Rand and uses mutex locking to allow for safe goroutines.

If you want to use a more performant source please use NewUnlocked. Be aware that it is not goroutine safe.

import "github.com/brianvoe/gofakeit/v6"

// Uses math/rand(Pseudo) with mutex locking
faker := gofakeit.New(0)

// Uses math/rand(Pseudo) with NO mutext locking
// More performant but not goroutine safe.
faker := gofakeit.NewUnlocked(0)

// Uses crypto/rand(cryptographically secure) with mutext locking
faker := gofakeit.NewCrypto()

// Pass in your own random source
faker := gofakeit.NewCustom()

Global Rand Set

If you would like to use the simple function calls but need to use something like crypto/rand you can override the default global with the random source that you want.

import "github.com/brianvoe/gofakeit/v6"

faker := gofakeit.NewCrypto()
gofakeit.SetGlobalFaker(faker)

Struct

Gofakeit can generate random data for struct fields. For the most part it covers all the basic type as well as some non-basic like time.Time.

Struct fields can also use tags to more specifically generate data for that field type.

import "github.com/brianvoe/gofakeit/v6"

// Create structs with random injected data
type Foo struct {
	Str           string
	Int           int
	Pointer       *int
	Name          string         `fake:"{firstname}"`         // Any available function all lowercase
	Sentence      string         `fake:"{sentence:3}"`        // Can call with parameters
	RandStr       string         `fake:"{randomstring:[hello,world]}"`
	Number        string         `fake:"{number:1,10}"`       // Comma separated for multiple values
	Regex         string         `fake:"{regex:[abcdef]{5}}"` // Generate string from regex
	Map           map[string]int `fakesize:"2"`
	Array         []string       `fakesize:"2"`
	ArrayRange    []string       `fakesize:"2,6"`
    Bar           Bar
	Skip          *string        `fake:"skip"`                // Set to "skip" to not generate data for
	SkipAlt       *string        `fake:"-"`                   // Set to "-" to not generate data for
	Created       time.Time                                   // Can take in a fake tag as well as a format tag
	CreatedFormat time.Time      `fake:"{year}-{month}-{day}" format:"2006-01-02"`
}

type Bar struct {
	Name    string
	Number  int
	Float   float32
}

// Pass your struct as a pointer
var f Foo
gofakeit.Struct(&f)

fmt.Println(f.Str)      		// hrukpttuezptneuvunh
fmt.Println(f.Int)      		// -7825289004089916589
fmt.Println(*f.Pointer) 		// -343806609094473732
fmt.Println(f.Name)     		// fred
fmt.Println(f.Sentence) 		// Record river mind.
fmt.Println(f.RandStr)  		// world
fmt.Println(f.Number)   		// 4
fmt.Println(f.Regex)    		// cbdfc
fmt.Println(f.Map)    			// map[PxLIo:52 lxwnqhqc:846]
fmt.Println(f.Array)    		// cbdfc
fmt.Printf("%+v", f.Bar)    	// {Name:QFpZ Number:-2882647639396178786 Float:1.7636692e+37}
fmt.Println(f.Skip)     		// <nil>
fmt.Println(f.Created.String()) // 1908-12-07 04:14:25.685339029 +0000 UTC

// Supported formats
// int, int8, int16, int32, int64,
// uint, uint8, uint16, uint32, uint64,
// float32, float64,
// bool, string,
// array, pointers, map
// time.Time // If setting time you can also set a format tag
// Nested Struct Fields and Embedded Fields

Fakeable types

It is possible to extend a struct by implementing the Fakeable interface in order to control the generation.

For example, this is useful when it is not possible to modify the struct that you want to fake by adding struct tags to a field but you still need to be able to control the generation process.

// Custom string that you want to generate your own data for
// or just return a static value
type CustomString string

func (c *CustomString) Fake(faker *gofakeit.Faker) (any, error) {
	return CustomString("my custom string")
}

// Imagine a CustomTime type that is needed to support a custom JSON Marshaler
type CustomTime time.Time

func (c *CustomTime) Fake(faker *gofakeit.Faker) (any, error) {
	return CustomTime(time.Now())
}

func (c *CustomTime) MarshalJSON() ([]byte, error) {
	//...
}

// This is the struct that we cannot modify to add struct tags
type NotModifiable struct {
	Token string
	Value CustomString
	Creation *CustomTime
}

var f NotModifiable
gofakeit.Struct(&f)
fmt.Printf("%s", f.Token) // yvqqdH
fmt.Printf("%s", f.Value) // my custom string
fmt.Printf("%s", f.Creation) // 2023-04-02 23:00:00 +0000 UTC m=+0.000000001

Custom Functions

In a lot of situations you may need to use your own random function usage for your specific needs.

If you would like to extend the usage of struct tags, generate function, available usages in the gofakeit server or gofakeit command sub packages. You can do so via the AddFuncLookup. Each function has their own lookup, if you need more reference examples you can look at each files lookups.

// Simple
gofakeit.AddFuncLookup("friendname", gofakeit.Info{
	Category:    "custom",
	Description: "Random friend name",
	Example:     "bill",
	Output:      "string",
	Generate: func(r *rand.Rand, m *gofakeit.MapParams, info *gofakeit.Info) (any, error) {
		return gofakeit.RandomString([]string{"bill", "bob", "sally"}), nil
	},
})

// With Params
gofakeit.AddFuncLookup("jumbleword", gofakeit.Info{
	Category:    "jumbleword",
	Description: "Take a word and jumble it up",
	Example:     "loredlowlh",
	Output:      "string",
	Params: []gofakeit.Param{
		{Field: "word", Type: "string", Description: "Word you want to jumble"},
	},
	Generate: func(r *rand.Rand, m *gofakeit.MapParams, info *gofakeit.Info) (any, error) {
		word, err := info.GetString(m, "word")
		if err != nil {
			return nil, err
		}

		split := strings.Split(word, "")
		gofakeit.ShuffleStrings(split)
		return strings.Join(split, ""), nil
	},
})

type Foo struct {
	FriendName string `fake:"{friendname}"`
	JumbleWord string `fake:"{jumbleword:helloworld}"`
}

var f Foo
gofakeit.Struct(&f)
fmt.Printf("%s", f.FriendName) // bill
fmt.Printf("%s", f.JumbleWord) // loredlowlh

Templates

Generate custom outputs using golang's template engine https://pkg.go.dev/text/template.

We have added all the available functions to the template engine as well as some additional ones that are useful for template building.

Additional Available Functions

- ToUpper(s string) string   // Make string upper case
- ToLower(s string) string   // Make string lower case
- ToString(s any)            // Convert to string
- ToDate(s string) time.Time // Convert string to date
- SpliceAny(args ...any) []any // Build a slice of anys, used with Weighted
- SpliceString(args ...string) []string // Build a slice of strings, used with Teams and RandomString
- SpliceUInt(args ...uint) []uint // Build a slice of uint, used with Dice and RandomUint
- SpliceInt(args ...int) []int // Build a slice of int, used with RandomInt
Unavailable Gofakeit functions
// Any functions that dont have a return value
- AnythingThatReturnsVoid(): void

// Not available to use in templates
- Template(co *TemplateOptions) ([]byte, error)
- RandomMapKey(mapI any) any
Example Usages
import "github.com/brianvoe/gofakeit/v6"

func main() {
	// Accessing the Lines variable from within the template.
	template := `
	Subject: {{RandomString (SliceString "Greetings" "Hello" "Hi")}}

	Dear {{LastName}},

	{{RandomString (SliceString "Greetings!" "Hello there!" "Hi, how are you?")}}

	{{Paragraph 1 5 10 "\n\n"}}

	{{RandomString (SliceString "Warm regards" "Best wishes" "Sincerely")}}
	{{$person:=Person}}
	{{$person.FirstName}} {{$person.LastName}}
	{{$person.Email}}
	{{$person.Phone}}
	`

	value, err := gofakeit.Template(template, &TemplateOptions{Data: 5})

	if err != nil {
		fmt.Println(err)
	}

	fmt.Println(string(value))
}

Output:

Subject: Hello

Dear Krajcik,

Greetings!

Quia voluptatem voluptatem voluptatem. Quia voluptatem voluptatem voluptatem. Quia voluptatem voluptatem voluptatem.

Warm regards
Kaitlyn Krajcik
kaitlynkrajcik@krajcik
570-245-7485

Functions

All functions also exist as methods on the Faker struct

File

Passing nil to CSV, JSON or XML will auto generate data using default values.

CSV(co *CSVOptions) ([]byte, error)
JSON(jo *JSONOptions) ([]byte, error)
XML(xo *XMLOptions) ([]byte, error)
FileExtension() string
FileMimeType() string
Template

Passing nil will auto generate data using default values.

Template(co *TemplateOptions) (string, error)
Markdown(co *MarkdownOptions) (string, error)
EmailText(co *EmailOptions) (string, error)
FixedWidth(co *FixedWidthOptions) (string, error)
Product
Product() *ProductInfo
ProductName() string
ProductDescription() string
ProductCategory() string
ProductFeature() string
ProductMaterial() string
Person
Person() *PersonInfo
Name() string
NamePrefix() string
NameSuffix() string
FirstName() string
MiddleName() string
LastName() string
Gender() string
SSN() string
Hobby() string
Contact() *ContactInfo
Email() string
Phone() string
PhoneFormatted() string
Teams(peopleArray []string, teamsArray []string) map[string][]string
Generate
Struct(v any)
Slice(v any)
Map() map[string]any
Generate(value string) string
Regex(value string) string
Auth
Username() string
Password(lower bool, upper bool, numeric bool, special bool, space bool, num int) string
Address
Address() *AddressInfo
City() string
Country() string
CountryAbr() string
State() string
StateAbr() string
Street() string
StreetName() string
StreetNumber() string
StreetPrefix() string
StreetSuffix() string
Zip() string
Latitude() float64
LatitudeInRange(min, max float64) (float64, error)
Longitude() float64
LongitudeInRange(min, max float64) (float64, error)
Game
Gamertag() string
Dice(numDice uint, sides []uint) []uint
Beer
BeerAlcohol() string
BeerBlg() string
BeerHop() string
BeerIbu() string
BeerMalt() string
BeerName() string
BeerStyle() string
BeerYeast() string
Car
Car() *CarInfo
CarMaker() string
CarModel() string
CarType() string
CarFuelType() string
CarTransmissionType() string
Words
// Nouns
Noun() string
NounCommon() string
NounConcrete() string
NounAbstract() string
NounCollectivePeople() string
NounCollectiveAnimal() string
NounCollectiveThing() string
NounCountable() string
NounUncountable() string

// Verbs
Verb() string
VerbAction() string
VerbLinking() string
VerbHelping() string

// Adverbs
Adverb() string
AdverbManner() string
AdverbDegree() string
AdverbPlace() string
AdverbTimeDefinite() string
AdverbTimeIndefinite() string
AdverbFrequencyDefinite() string
AdverbFrequencyIndefinite() string

// Propositions
Preposition() string
PrepositionSimple() string
PrepositionDouble() string
PrepositionCompound() string

// Adjectives
Adjective() string
AdjectiveDescriptive() string
AdjectiveQuantitative() string
AdjectiveProper() string
AdjectiveDemonstrative() string
AdjectivePossessive() string
AdjectiveInterrogative() string
AdjectiveIndefinite() string

// Pronouns
Pronoun() string
PronounPersonal() string
PronounObject() string
PronounPossessive() string
PronounReflective() string
PronounDemonstrative() string
PronounInterrogative() string
PronounRelative() string

// Connectives
Connective() string
ConnectiveTime() string
ConnectiveComparative() string
ConnectiveComplaint() string
ConnectiveListing() string
ConnectiveCasual() string
ConnectiveExamplify() string

// Words
Word() string

// Sentences
Sentence(wordCount int) string
Paragraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
LoremIpsumWord() string
LoremIpsumSentence(wordCount int) string
LoremIpsumParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
Question() string
Quote() string
Phrase() string
Foods
Fruit() string
Vegetable() string
Breakfast() string
Lunch() string
Dinner() string
Snack() string
Dessert() string
Misc
Bool() bool
UUID() string
Weighted(options []any, weights []float32) (any, error)
FlipACoin() string
RandomMapKey(mapI any) any
ShuffleAnySlice(v any)
Colors
Color() string
HexColor() string
RGBColor() []int
SafeColor() string
NiceColors() string
Images
ImageURL(width int, height int) string
Image(width int, height int) *img.RGBA
ImageJpeg(width int, height int) []byte
ImagePng(width int, height int) []byte
Internet
URL() string
DomainName() string
DomainSuffix() string
IPv4Address() string
IPv6Address() string
MacAddress() string
HTTPStatusCode() string
HTTPStatusCodeSimple() int
LogLevel(logType string) string
HTTPMethod() string
HTTPVersion() string
UserAgent() string
ChromeUserAgent() string
FirefoxUserAgent() string
OperaUserAgent() string
SafariUserAgent() string
HTML
InputName() string
Svg(options *SVGOptions) string
Date/Time
Date() time.Time
PastDate() time.Time
FutureDate() time.Time
DateRange(start, end time.Time) time.Time
NanoSecond() int
Second() int
Minute() int
Hour() int
Month() int
MonthString() string
Day() int
WeekDay() string
Year() int
TimeZone() string
TimeZoneAbv() string
TimeZoneFull() string
TimeZoneOffset() float32
TimeZoneRegion() string
Payment
Price(min, max float64) float64
CreditCard() *CreditCardInfo
CreditCardCvv() string
CreditCardExp() string
CreditCardNumber(*CreditCardOptions) string
CreditCardType() string
Currency() *CurrencyInfo
CurrencyLong() string
CurrencyShort() string
AchRouting() string
AchAccount() string
BitcoinAddress() string
BitcoinPrivateKey() string
Finance
Cusip() string
Isin() string
Company
BS() string
Blurb() string
BuzzWord() string
Company() string
CompanySuffix() string
Job() *JobInfo
JobDescriptor() string
JobLevel() string
JobTitle() string
Slogan() string
Hacker
HackerAbbreviation() string
HackerAdjective() string
Hackeringverb() string
HackerNoun() string
HackerPhrase() string
HackerVerb() string
Hipster
HipsterWord() string
HipsterSentence(wordCount int) string
HipsterParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string
App
AppName() string
AppVersion() string
AppAuthor() string
Animal
PetName() string
Animal() string
AnimalType() string
FarmAnimal() string
Cat() string
Dog() string
Bird() string
Emoji
Emoji() string
EmojiDescription() string
EmojiCategory() string
EmojiAlias() string
EmojiTag() string
Language
Language() string
LanguageAbbreviation() string
ProgrammingLanguage() string
ProgrammingLanguageBest() string
Number
Number(min int, max int) int
Int8() int8
Int16() int16
Int32() int32
Int64() int64
Uint8() uint8
Uint16() uint16
Uint32() uint32
Uint64() uint64
Float32() float32
Float32Range(min, max float32) float32
Float64() float64
Float64Range(min, max float64) float64
ShuffleInts(a []int)
RandomInt(i []int) int
HexUint8() string
HexUint16() string
HexUint32() string
HexUint64() string
HexUint128() string
HexUint256() string
String
Digit() string
DigitN(n uint) string
Letter() string
LetterN(n uint) string
Lexify(str string) string
Numerify(str string) string
ShuffleStrings(a []string)
RandomString(a []string) string
Celebrity
CelebrityActor() string
CelebrityBusiness() string
CelebritySport() string
Minecraft
MinecraftOre() string
MinecraftWood() string
MinecraftArmorTier() string
MinecraftArmorPart() string
MinecraftWeapon() string
MinecraftTool() string
MinecraftDye() string
MinecraftFood() string
MinecraftAnimal() string
MinecraftVillagerJob() string
MinecraftVillagerStation() string
MinecraftVillagerLevel() string
MinecraftMobPassive() string
MinecraftMobNeutral() string
MinecraftMobHostile() string
MinecraftMobBoss() string
MinecraftBiome() string
MinecraftWeather() string
Book
Book() *BookInfo
BookTitle() string
BookAuthor() string
BookGenre() string
Movie
Movie() *MovieInfo
MovieName() string
MovieGenre() string
Error
Error() error
ErrorDatabase() error
ErrorGRPC() error
ErrorHTTP() error
ErrorHTTPClient() error
ErrorHTTPServer() error
ErrorInput() error
ErrorRuntime() error
School
School() string

Documentation

Overview

Package gofakeit provides a set of functions that generate random data

Example
Seed(11)
fmt.Println("Name:", Name())
fmt.Println("Email:", Email())
fmt.Println("Phone:", Phone())
fmt.Println("Address:", Address().Address)
fmt.Println("BS:", BS())
fmt.Println("Beer Name:", BeerName())
fmt.Println("Color:", Color())
fmt.Println("Company:", Company())
fmt.Println("Credit Card:", CreditCardNumber(nil))
fmt.Println("Hacker Phrase:", HackerPhrase())
fmt.Println("Job Title:", JobTitle())
fmt.Println("Password:", Password(true, true, true, true, false, 32))
Output:

Name: Markus Moen
Email: alaynawuckert@kozey.biz
Phone: 9948995369
Address: 35300 South Roadshaven, Miami, Tennessee 58302
BS: streamline
Beer Name: Pliny The Elder
Color: Gray
Company: Center for Responsive Politics
Credit Card: 3821714800889989
Hacker Phrase: Overriding the capacitor won't do anything, we need to compress the online SMTP protocol!
Job Title: Supervisor
Password: #8L79W6s4E9jT2Q047??YkyD0xxnC2#u
Example (Custom)
Seed(11)

AddFuncLookup("friendname", Info{
	Category:    "custom",
	Description: "Random friend name",
	Example:     "bill",
	Output:      "string",
	Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
		return RandomString([]string{"bill", "bob", "sally"}), nil
	},
})

type Foo struct {
	FriendName string `fake:"{friendname}"`
}

var f Foo
Struct(&f)

fmt.Printf("%s", f.FriendName)
Output:

bill
Example (Custom_with_params)
Seed(11)

AddFuncLookup("jumbleword", Info{
	Category:    "jumbleword",
	Description: "Take a word and jumple it up",
	Example:     "loredlowlh",
	Output:      "string",
	Params: []Param{
		{Field: "word", Type: "int", Description: "Word you want to jumble"},
	},
	Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
		word, err := info.GetString(m, "word")
		if err != nil {
			return nil, err
		}

		split := strings.Split(word, "")
		ShuffleStrings(split)
		return strings.Join(split, ""), nil
	},
})

type Foo struct {
	JumbleWord string `fake:"{jumbleword:helloworld}"`
}

var f Foo
Struct(&f)

fmt.Printf("%s", f.JumbleWord)
Output:

loredlowlh

Index

Examples

Constants

This section is empty.

Variables

View Source
var FuncLookups map[string]Info

FuncLookups is the primary map array with mapping to all available data

Functions

func AchAccount

func AchAccount() string

AchAccount will generate a 12 digit account number

Example
Seed(11)
fmt.Println(AchAccount())
Output:

413645994899

func AchRouting

func AchRouting() string

AchRouting will generate a 9 digit routing number

Example
Seed(11)
fmt.Println(AchRouting())
Output:

713645994

func AddFuncLookup

func AddFuncLookup(functionName string, info Info)

AddFuncLookup takes a field and adds it to map

func Adjective

func Adjective() string

Adjective will generate a random adjective

Example
Seed(11)
fmt.Println(Adjective())
Output:

Dutch

func AdjectiveDemonstrative added in v6.11.0

func AdjectiveDemonstrative() string

AdjectiveDemonstrative will generate a random demonstrative adjective

Example
Seed(11)
fmt.Println(AdjectiveDemonstrative())
Output:

this

func AdjectiveDescriptive added in v6.11.0

func AdjectiveDescriptive() string

AdjectiveDescriptive will generate a random descriptive adjective

Example
Seed(11)
fmt.Println(AdjectiveDescriptive())
Output:

brave

func AdjectiveIndefinite added in v6.11.0

func AdjectiveIndefinite() string

AdjectiveIndefinite will generate a random indefinite adjective

Example
Seed(11)
fmt.Println(AdjectiveIndefinite())
Output:

few

func AdjectiveInterrogative added in v6.11.0

func AdjectiveInterrogative() string

AdjectiveInterrogative will generate a random interrogative adjective

Example
Seed(11)
fmt.Println(AdjectiveInterrogative())
Output:

what

func AdjectivePossessive added in v6.11.0

func AdjectivePossessive() string

AdjectivePossessive will generate a random possessive adjective

Example
Seed(11)
fmt.Println(AdjectivePossessive())
Output:

our

func AdjectiveProper added in v6.11.0

func AdjectiveProper() string

AdjectiveProper will generate a random proper adjective

Example
Seed(11)
fmt.Println(AdjectiveProper())
Output:

Afghan

func AdjectiveQuantitative added in v6.11.0

func AdjectiveQuantitative() string

AdjectiveQuantitative will generate a random quantitative adjective

Example
Seed(11)
fmt.Println(AdjectiveQuantitative())
Output:

a little

func Adverb

func Adverb() string

Adverb will generate a random adverb

Example
Seed(11)
fmt.Println(Adverb())
Output:

over

func AdverbDegree added in v6.11.0

func AdverbDegree() string

AdverbDegree will generate a random degree adverb

Example
Seed(11)
fmt.Println(AdverbDegree())
Output:

intensely

func AdverbFrequencyDefinite added in v6.11.0

func AdverbFrequencyDefinite() string

AdverbFrequencyDefinite will generate a random frequency definite adverb

Example
Seed(11)
fmt.Println(AdverbFrequencyDefinite())
Output:

hourly

func AdverbFrequencyIndefinite added in v6.11.0

func AdverbFrequencyIndefinite() string

AdverbFrequencyIndefinite will generate a random frequency indefinite adverb

Example
Seed(11)
fmt.Println(AdverbFrequencyIndefinite())
Output:

occasionally

func AdverbManner added in v6.11.0

func AdverbManner() string

AdverbManner will generate a random manner adverb

Example
Seed(11)
fmt.Println(AdverbManner())
Output:

stupidly

func AdverbPlace added in v6.11.0

func AdverbPlace() string

AdverbPlace will generate a random place adverb

Example
Seed(11)
fmt.Println(AdverbPlace())
Output:

east

func AdverbTimeDefinite added in v6.11.0

func AdverbTimeDefinite() string

AdverbTimeDefinite will generate a random time definite adverb

Example
Seed(11)
fmt.Println(AdverbTimeDefinite())
Output:

now

func AdverbTimeIndefinite added in v6.11.0

func AdverbTimeIndefinite() string

AdverbTimeIndefinite will generate a random time indefinite adverb

Example
Seed(11)
fmt.Println(AdverbTimeIndefinite())
Output:

already

func Animal

func Animal() string

Animal will return a random animal

Example
Seed(11)
fmt.Println(Animal())
Output:

elk

func AnimalType

func AnimalType() string

AnimalType will return a random animal type

Example
Seed(11)
fmt.Println(AnimalType())
Output:

amphibians

func AppAuthor

func AppAuthor() string

AppAuthor will generate a random company or person name

Example
Seed(11)
fmt.Println(AppAuthor())
Output:

Marcel Pagac

func AppName

func AppName() string

AppName will generate a random app name

Example
Seed(11)
fmt.Println(AppName())
Output:

Oxbeing

func AppVersion

func AppVersion() string

AppVersion will generate a random app version

Example
Seed(11)
fmt.Println(AppVersion())
Output:

1.17.20

func BS

func BS() string

BS will generate a random company bs string

Example
Seed(11)
fmt.Println(BS())
Output:

front-end

func BeerAlcohol

func BeerAlcohol() string

BeerAlcohol will return a random beer alcohol level between 2.0 and 10.0

Example
Seed(11)
fmt.Println(BeerAlcohol())
Output:

2.7%

func BeerBlg

func BeerBlg() string

BeerBlg will return a random beer blg between 5.0 and 20.0

Example
Seed(11)
fmt.Println(BeerBlg())
Output:

6.4°Blg

func BeerHop

func BeerHop() string

BeerHop will return a random beer hop

Example
Seed(11)
fmt.Println(BeerHop())
Output:

Glacier

func BeerIbu

func BeerIbu() string

BeerIbu will return a random beer ibu value between 10 and 100

Example
Seed(11)
fmt.Println(BeerIbu())
Output:

47 IBU

func BeerMalt

func BeerMalt() string

BeerMalt will return a random beer malt

Example
Seed(11)
fmt.Println(BeerMalt())
Output:

Munich

func BeerName

func BeerName() string

BeerName will return a random beer name

Example
Seed(11)
fmt.Println(BeerName())
Output:

Duvel

func BeerStyle

func BeerStyle() string

BeerStyle will return a random beer style

Example
Seed(11)
fmt.Println(BeerStyle())
Output:

European Amber Lager

func BeerYeast

func BeerYeast() string

BeerYeast will return a random beer yeast

Example
Seed(11)
fmt.Println(BeerYeast())
Output:

1388 - Belgian Strong Ale

func Bird added in v6.20.0

func Bird() string

Bird will return a random bird species

Example
Seed(11)
fmt.Println(Bird())
Output:

goose

func BitcoinAddress

func BitcoinAddress() string

BitcoinAddress will generate a random bitcoin address consisting of numbers, upper and lower characters

Example
Seed(11)
fmt.Println(BitcoinAddress())
Output:

1zXE46Al58w4vS0459PHl6YwElXZH09e

func BitcoinPrivateKey

func BitcoinPrivateKey() string

BitcoinPrivateKey will generate a random bitcoin private key base58 consisting of numbers, upper and lower characters

Example
Seed(11)
fmt.Println(BitcoinPrivateKey())
Output:

5KWjEJ7SnBNJyDjdPUjLuYByYzM9rG1trax8c2NTSBtv7YtR57v

func Blurb added in v6.22.0

func Blurb() string

Blurb will generate a random company blurb string

Example
Seed(11)
fmt.Println(Blurb())
Output:

Motivation

func BookAuthor added in v6.22.0

func BookAuthor() string
Example
Seed(11)
fmt.Println(BookAuthor())
Output:

James Joyce

func BookGenre added in v6.22.0

func BookGenre() string
Example
Seed(11)
fmt.Println(BookGenre())
Output:

Crime

func BookTitle added in v6.22.0

func BookTitle() string
Example
Seed(11)
fmt.Println(BookTitle())
Output:

Anna Karenina

func Bool

func Bool() bool

Bool will generate a random boolean value

Example
Seed(11)
fmt.Println(Bool())
Output:

true

func Breakfast

func Breakfast() string

Breakfast will return a random breakfast name

Example
Seed(11)
fmt.Println(Breakfast())
Output:

Blueberry banana happy face pancakes

func BuzzWord

func BuzzWord() string

BuzzWord will generate a random company buzz word string

Example
Seed(11)
fmt.Println(BuzzWord())
Output:

disintermediate

func CSV

func CSV(co *CSVOptions) ([]byte, error)

CSV generates an object or an array of objects in json format A nil CSVOptions returns a randomly structured CSV.

Example (Array)
Seed(11)

value, err := CSV(&CSVOptions{
	RowCount: 3,
	Fields: []Field{
		{Name: "id", Function: "autoincrement"},
		{Name: "first_name", Function: "firstname"},
		{Name: "last_name", Function: "lastname"},
		{Name: "password", Function: "password", Params: MapParams{"special": {"false"}}},
	},
})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

id,first_name,last_name,password
1,Markus,Moen,856Y5wPZevX9
2,Jalon,Rolfson,64wz4EAS0Hl0
3,Nestor,Harris,14GKq1j7Lx4T

func CarFuelType

func CarFuelType() string

CarFuelType will return a random fuel type

Example
Seed(11)
fmt.Println(CarFuelType())
Output:

CNG

func CarMaker

func CarMaker() string

CarMaker will return a random car maker

Example
Seed(11)
fmt.Println(CarMaker())
Output:

Nissan

func CarModel

func CarModel() string

CarModel will return a random car model

Example
Seed(11)
fmt.Println(CarModel())
Output:

Aveo

func CarTransmissionType

func CarTransmissionType() string

CarTransmissionType will return a random transmission type

Example
Seed(11)
fmt.Println(CarTransmissionType())
Output:

Manual

func CarType

func CarType() string

CarType will generate a random car type string

Example
Seed(11)
fmt.Println(CarType())
Output:

Passenger car mini

func Cat

func Cat() string

Cat will return a random cat breed

Example
Seed(11)
fmt.Println(Cat())
Output:

Sokoke

func Categories

func Categories() map[string][]string

Categories will return a map string array of available data categories and sub categories

func CelebrityActor added in v6.11.0

func CelebrityActor() string

CelebrityActor will generate a random celebrity actor

Example
Seed(11)
fmt.Println(CelebrityActor())
Output:

Owen Wilson

func CelebrityBusiness added in v6.11.0

func CelebrityBusiness() string

CelebrityBusiness will generate a random celebrity business person

Example
Seed(11)
fmt.Println(CelebrityBusiness())
Output:

Cameron Diaz

func CelebritySport added in v6.11.0

func CelebritySport() string

CelebritySport will generate a random celebrity sport person

Example
Seed(11)
fmt.Println(CelebritySport())
Output:

Hicham El Guerrouj

func ChromeUserAgent

func ChromeUserAgent() string

ChromeUserAgent will generate a random chrome browser user agent string

Example
Seed(11)
fmt.Println(ChromeUserAgent())
Output:

Mozilla/5.0 (X11; Linux i686) AppleWebKit/5360 (KHTML, like Gecko) Chrome/40.0.889.0 Mobile Safari/5360

func City

func City() string

City will generate a random city string

Example
Seed(11)
fmt.Println(City())
Output:

Plano

func Color

func Color() string

Color will generate a random color string

Example
Seed(11)
fmt.Println(Color())
Output:

MediumOrchid

func Comment added in v6.28.0

func Comment() string

Comment will generate a random statement or remark expressing an opinion, observation, or reaction

Example
Seed(11)
fmt.Println(Comment())
Output:

Phew Substantial Thing Had Regularly.

func Company

func Company() string

Company will generate a random company name string

Example
Seed(11)
fmt.Println(Company())
Output:

ClearHealthCosts

func CompanySuffix

func CompanySuffix() string

CompanySuffix will generate a random company suffix string

Example
Seed(11)
fmt.Println(CompanySuffix())
Output:

Inc

func Connective added in v6.11.0

func Connective() string

Connective will generate a random connective

Example
Seed(11)
fmt.Println(Connective())
Output:

such as

func ConnectiveCasual added in v6.11.0

func ConnectiveCasual() string

ConnectiveCasual will generate a random casual connective

Example
Seed(11)
fmt.Println(ConnectiveCasual())
Output:

an outcome of

func ConnectiveComparative added in v6.23.0

func ConnectiveComparative() string

ConnectiveComparative will generate a random comparative connective

Example
Seed(11)
fmt.Println(ConnectiveComparative())
Output:

in addition

func ConnectiveComplaint added in v6.11.0

func ConnectiveComplaint() string

ConnectiveComplaint will generate a random complaint connective

Example
Seed(11)
fmt.Println(ConnectiveComplaint())
Output:

besides

func ConnectiveExamplify added in v6.11.0

func ConnectiveExamplify() string

ConnectiveExamplify will generate a random examplify connective

Example
Seed(11)
fmt.Println(ConnectiveExamplify())
Output:

then

func ConnectiveListing added in v6.11.0

func ConnectiveListing() string

ConnectiveListing will generate a random listing connective

Example
Seed(11)
fmt.Println(ConnectiveListing())
Output:

firstly

func ConnectiveTime added in v6.11.0

func ConnectiveTime() string

ConnectiveTime will generate a random connective time

Example
Seed(11)
fmt.Println(ConnectiveTime())
Output:

finally

func Country

func Country() string

Country will generate a random country string

Example
Seed(11)
fmt.Println(Country())
Output:

Cabo Verde

func CountryAbr

func CountryAbr() string

CountryAbr will generate a random abbreviated country string

Example
Seed(11)
fmt.Println(CountryAbr())
Output:

CV

func CreditCardCvv

func CreditCardCvv() string

CreditCardCvv will generate a random CVV number Its a string because you could have 017 as an exp date

Example
Seed(11)
fmt.Println(CreditCardCvv())
Output:

513

func CreditCardExp

func CreditCardExp() string

CreditCardExp will generate a random credit card expiration date string Exp date will always be a future date

Example
Seed(11)
fmt.Println(CreditCardExp())
Output:

06/31

func CreditCardNumber

func CreditCardNumber(cco *CreditCardOptions) string

CreditCardNumber will generate a random luhn credit card number

Example
Seed(11)
fmt.Println(CreditCardNumber(nil))
fmt.Println(CreditCardNumber(&CreditCardOptions{Types: []string{"visa", "discover"}}))
fmt.Println(CreditCardNumber(&CreditCardOptions{Bins: []string{"4111"}}))
fmt.Println(CreditCardNumber(&CreditCardOptions{Gaps: true}))
Output:

4136459948995375
4635300425914586
4111232020276132
3054 800889 9827

func CreditCardType

func CreditCardType() string

CreditCardType will generate a random credit card type string

Example
Seed(11)
fmt.Println(CreditCardType())
Output:

Visa

func CurrencyLong

func CurrencyLong() string

CurrencyLong will generate a random long currency name

Example
Seed(11)
fmt.Println(CurrencyLong())
Output:

Iraq Dinar

func CurrencyShort

func CurrencyShort() string

CurrencyShort will generate a random short currency value

Example
Seed(11)
fmt.Println(CurrencyShort())
Output:

IQD

func Cusip added in v6.21.0

func Cusip() string

CUSIP

Example

CUSIP Tests

Seed(11)
fmt.Println(Cusip())
Output:

MLRQCZBX0

func Date

func Date() time.Time

Date will generate a random time.Time struct

Example
Seed(11)
fmt.Println(Date())
Output:

1915-01-24 13:00:35.820738079 +0000 UTC

func DateRange

func DateRange(start, end time.Time) time.Time

DateRange will generate a random time.Time struct between a start and end date

Example
Seed(11)
fmt.Println(DateRange(time.Unix(0, 484633944473634951), time.Unix(0, 1431318744473668209))) // May 10, 1985 years to May 10, 2015
Output:

2012-02-04 14:10:37.166933216 +0000 UTC

func Day

func Day() int

Day will generate a random day between 1 - 31

Example
Seed(11)
fmt.Println(Day())
Output:

23

func Dessert

func Dessert() string

Dessert will return a random dessert name

Example
Seed(11)
fmt.Println(Dessert())
Output:

French napoleons

func Dice added in v6.14.0

func Dice(numDice uint, sides []uint) []uint

Dice will generate a random set of dice

Example
Seed(11)
fmt.Println(Dice(1, []uint{6}))
Output:

[6]

func Digit

func Digit() string

Digit will generate a single ASCII digit

Example
Seed(11)
fmt.Println(Digit())
Output:

0

func DigitN

func DigitN(n uint) string

DigitN will generate a random string of length N consists of ASCII digits. Note that the string generated can start with 0 and this function returns a string with a length of 1 when 0 is passed.

Example
Seed(11)
fmt.Println(DigitN(10))
Output:

0136459948

func Dinner

func Dinner() string

Dinner will return a random dinner name

Example
Seed(11)
fmt.Println(Dinner())
Output:

Wild addicting dip

func Dog

func Dog() string

Dog will return a random dog breed

Example
Seed(11)
fmt.Println(Dog())
Output:

Norwich Terrier

func DomainName

func DomainName() string

DomainName will generate a random url domain name

Example
Seed(11)
fmt.Println(DomainName())
Output:

centraltarget.biz

func DomainSuffix

func DomainSuffix() string

DomainSuffix will generate a random domain suffix

Example
Seed(11)
fmt.Println(DomainSuffix())
Output:

org

func Drink added in v6.19.0

func Drink() string

Drink will return a random drink name

Example
Seed(11)
fmt.Println(Drink())
Output:

Juice

func Email

func Email() string

Email will generate a random email string

Example
Seed(11)
fmt.Println(Email())
Output:

markusmoen@pagac.net

func EmailText added in v6.25.0

func EmailText(co *EmailOptions) (string, error)

EmailText will return a single random text email template document

Example
Seed(11)

value, err := EmailText(&EmailOptions{})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

	Subject: Greetings from Marcel!

Dear Pagac,

Hello there! Sending positive vibes your way.

I hope you're doing great. May your week be filled with joy.

This me far smile where was by army party riches. Theirs instead here mine whichever that those instance growth has. Ouch enough Swiss us since down he she aha us. You to upon how this this furniture way no play. Towel that us to accordingly theirs purse enough so though.

Election often until eek weekly yet oops until conclude his. Stay elsewhere such that galaxy clean that last each stack. Reluctantly theirs wisp aid firstly highly butter accordingly should already. Calm shake according fade neither kuban upon this he fortnightly. Occasionally bunch on who elsewhere lastly hourly right there honesty.

We is how result out Shakespearean have whom yearly another. Packet are behind late lot finally time themselves goodness quizzical. Our therefore could fact cackle yourselves zebra for whose enormously. All bowl out wandering secondly yellow another your hourly spit. Since tomorrow hers words little think will our by Polynesian.

I'm curious to know what you think about it. If you have a moment, please feel free to check out the project on GitLab

Your insights would be invaluable. Your thoughts matter to me.

I appreciate your attention to this matter. Your feedback is greatly appreciated.

Best wishes
Daryl Leannon
oceaneokuneva@roberts.org
1-816-608-2233

func Emoji

func Emoji() string

Emoji will return a random fun emoji

Example
Seed(11)
fmt.Println(Emoji())
Output:

🧛

func EmojiAlias

func EmojiAlias() string

EmojiAlias will return a random fun emoji alias

Example
Seed(11)
fmt.Println(EmojiAlias())
Output:

deaf_person

func EmojiCategory

func EmojiCategory() string

EmojiCategory will return a random fun emoji category

Example
Seed(11)
fmt.Println(EmojiCategory())
Output:

Food & Drink

func EmojiDescription

func EmojiDescription() string

EmojiDescription will return a random fun emoji description

Example
Seed(11)
fmt.Println(EmojiDescription())
Output:

confetti ball

func EmojiTag

func EmojiTag() string

EmojiTag will return a random fun emoji tag

Example
Seed(11)
fmt.Println(EmojiTag())
Output:

strong

func Error added in v6.20.0

func Error() error

Error will return a random generic error

Example
Seed(11)
fmt.Println(Error())
Output:

failed to calculate pointer

func ErrorDatabase added in v6.20.0

func ErrorDatabase() error

ErrorDatabase will return a random database error

Example
Seed(11)
fmt.Println(ErrorDatabase())
Output:

bad connection

func ErrorGRPC added in v6.20.0

func ErrorGRPC() error

ErrorGRPC will return a random gRPC error

Example
Seed(11)
fmt.Println(ErrorGRPC())
Output:

connection refused

func ErrorHTTP added in v6.20.0

func ErrorHTTP() error

ErrorHTTP will return a random HTTP error

Example
Seed(11)
fmt.Println(ErrorHTTP())
Output:

wrote more than the declared Content-Length

func ErrorHTTPClient added in v6.20.0

func ErrorHTTPClient() error

ErrorHTTPClient will return a random HTTP client error response (400-418)

Example
Seed(11)
fmt.Println(ErrorHTTPClient())
Output:

payment required

func ErrorHTTPServer added in v6.20.0

func ErrorHTTPServer() error

ErrorHTTPServer will return a random HTTP server error response (500-511)

Example
Seed(11)
fmt.Println(ErrorHTTPServer())
Output:

internal server error

func ErrorObject added in v6.20.0

func ErrorObject() error

ErrorObject will return a random error object word

Example
Seed(11)
fmt.Println(ErrorObject())
Output:

argument

func ErrorRuntime added in v6.20.0

func ErrorRuntime() error

ErrorRuntime will return a random runtime error

Example
Seed(11)
fmt.Println(ErrorRuntime())
Output:

panic: runtime error: invalid memory address or nil pointer dereference

func ErrorValidation added in v6.20.0

func ErrorValidation() error

ErrorValidation will return a random validation error

Example
Seed(11)
fmt.Println(ErrorValidation())
Output:

state max length exceeded

func FarmAnimal

func FarmAnimal() string

FarmAnimal will return a random animal that usually lives on a farm

Example
Seed(11)
fmt.Println(FarmAnimal())
Output:

Chicken

func FileExtension

func FileExtension() string

FileExtension will generate a random file extension

Example
Seed(11)
fmt.Println(FileExtension())
Output:

nes

func FileMimeType

func FileMimeType() string

FileMimeType will generate a random mime file type

Example
Seed(11)
fmt.Println(FileMimeType())
Output:

application/dsptype

func FirefoxUserAgent

func FirefoxUserAgent() string

FirefoxUserAgent will generate a random firefox broswer user agent string

Example
Seed(11)
fmt.Println(FirefoxUserAgent())
Output:

Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_9_10 rv:7.0) Gecko/1915-01-24 Firefox/36.0

func FirstName

func FirstName() string

FirstName will generate a random first name

Example
Seed(11)
fmt.Println(FirstName())
Output:

Markus

func FixedWidth added in v6.25.0

func FixedWidth(co *FixedWidthOptions) (string, error)

FixedWidth generates an table of random data in fixed width format A nil FixedWidthOptions returns a randomly structured FixedWidth.

Example
Seed(11)

value, err := FixedWidth(&FixedWidthOptions{
	RowCount: 3,
	Fields: []Field{
		{Name: "Name", Function: "{firstname} {lastname}"},
		{Name: "Email", Function: "email"},
		{Name: "Password", Function: "password", Params: MapParams{"special": {"false"}}},
		{Name: "Age", Function: "{number:1,100}"},
	},
})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

Name               Email                          Password         Age
Markus Moen        sylvanmraz@murphy.net          46HX9elvE5zl     43
Alayna Wuckert     santinostanton@carroll.biz     l6A0EVSC90w2     11
Lura Lockman       zacherykuhic@feil.name         xxL47424u8Ts     4
Example (Default)
Seed(11)

value, err := FixedWidth(nil)
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

Name             Email                        Password
Marcel Pagac     anibalkozey@lockman.name     ETZmouyV0q1W
Example (NoHeader)
Seed(11)

value, err := FixedWidth(&FixedWidthOptions{
	RowCount: 3,
	Fields: []Field{
		{Name: "", Function: "{firstname} {lastname}"},
		{Name: "", Function: "email"},
		{Name: "", Function: "password", Params: MapParams{"special": {"false"}}},
		{Name: "", Function: "{number:1,100}"},
	},
})
if err != nil {
	fmt.Println(err)
}

fmt.Println(value)
Output:

Markus Moen        sylvanmraz@murphy.net          46HX9elvE5zl     43
Alayna Wuckert     santinostanton@carroll.biz     l6A0EVSC90w2     11
Lura Lockman       zacherykuhic@feil.name         xxL47424u8Ts     4

func FlipACoin

func FlipACoin() string

FlipACoin will return a random value of Heads or Tails

Example
Seed(11)
fmt.Println(FlipACoin())
Output:

Heads

func Float32

func Float32() float32

Float32 will generate a random float32 value

Example
Seed(11)
fmt.Println(Float32())
Output:

3.1128167e+37

func Float32Range

func Float32Range(min, max float32) float32

Float32Range will generate a random float32 value between min and max

Example
Seed(11)
fmt.Println(Float32Range(0, 9999999))
Output:

914774.6

func Float64

func Float64() float64

Float64 will generate a random float64 value

Example
Seed(11)
fmt.Println(Float64())
Output:

1.644484108270445e+307

func Float64Range

func Float64Range(min, max float64) float64

Float64Range will generate a random float64 value between min and max

Example
Seed(11)
fmt.Println(Float64Range(0, 9999999))
Output:

914774.5585333086

func Fruit

func Fruit() string

Fruit will return a random fruit name

Example
Seed(11)
fmt.Println(Fruit())
Output:

Peach

func FutureDate added in v6.23.0

func FutureDate() time.Time

FutureDate will generate a random future time.Time struct

Example
Seed(11)
fmt.Println(FutureDate())
Output:

func Gamertag

func Gamertag() string

Gamertag will generate a random video game username

Example
Seed(11)
fmt.Println(Gamertag())
Output:

PurpleSheep5

func Gender

func Gender() string

Gender will generate a random gender string

Example
Seed(11)
fmt.Println(Gender())
Output:

male

func Generate

func Generate(dataVal string) string

Generate fake information from given string. Replaceable values should be within {}

Functions Ex: {firstname} - billy Ex: {sentence:3} - Record river mind. Ex: {number:1,10} - 4 Ex: {uuid} - 590c1440-9888-45b0-bd51-a817ee07c3f2

Letters/Numbers Ex: ### - 481 - random numbers Ex: ??? - fda - random letters

For a complete list of runnable functions use FuncsLookup

Example
Seed(11)

fmt.Println(Generate("{firstname} {lastname} ssn is {ssn} and lives at {street}"))
fmt.Println(Generate("{sentence:3}"))
fmt.Println(Generate("{shuffleints:[1,2,3]}"))
fmt.Println(Generate("{randomint:[-1,2,3,-4]}"))
fmt.Println(Generate("{randomuint:[1,2,3,4]}"))
fmt.Println(Generate("{number:1,50}"))
fmt.Println(Generate("{shufflestrings:[key:value,int:string,1:2,a:b]}"))
Output:

Markus Moen ssn is 526643139 and lives at 599 Daleton
Congolese choir computer.
[3 1 2]
2
4
17
[int:string 1:2 a:b key:value]

func HTTPMethod

func HTTPMethod() string

HTTPMethod will generate a random http method

Example
Seed(11)
fmt.Println(HTTPMethod())
Output:

HEAD

func HTTPStatusCode

func HTTPStatusCode() int

HTTPStatusCode will generate a random status code

Example
Seed(11)
fmt.Println(HTTPStatusCode())
Output:

404

func HTTPStatusCodeSimple

func HTTPStatusCodeSimple() int

HTTPStatusCodeSimple will generate a random simple status code

Example
Seed(11)
fmt.Println(HTTPStatusCodeSimple())
Output:

200

func HTTPVersion added in v6.7.0

func HTTPVersion() string

HTTPVersion will generate a random http version

Example
Seed(11)
fmt.Println(HTTPVersion())
Output:

HTTP/1.0

func HackerAbbreviation

func HackerAbbreviation() string

HackerAbbreviation will return a random hacker abbreviation

Example
Seed(11)
fmt.Println(HackerAbbreviation())
Output:

ADP

func HackerAdjective

func HackerAdjective() string

HackerAdjective will return a random hacker adjective

Example
Seed(11)
fmt.Println(HackerAdjective())
Output:

wireless

func HackerNoun

func HackerNoun() string

HackerNoun will return a random hacker noun

Example
Seed(11)
fmt.Println(HackerNoun())
Output:

driver

func HackerPhrase

func HackerPhrase() string

HackerPhrase will return a random hacker sentence

Example
Seed(11)
fmt.Println(HackerPhrase())
Output:

If we calculate the program, we can get to the AI pixel through the redundant XSS matrix!

func HackerVerb

func HackerVerb() string

HackerVerb will return a random hacker verb

Example
Seed(11)
fmt.Println(HackerVerb())
Output:

synthesize

func HackeringVerb

func HackeringVerb() string

HackeringVerb will return a random hacker ingverb

Example
Seed(11)
fmt.Println(HackeringVerb())
Output:

connecting

func HexColor

func HexColor() string

HexColor will generate a random hexadecimal color string

Example
Seed(11)
fmt.Println(HexColor())
Output:

#a99fb4

func HexUint128 added in v6.7.1

func HexUint128() string

HexUint128 will generate a random uint128 hex value with "0x" prefix

Example
Seed(11)
fmt.Println(HexUint128())
Output:

0x875469578e51b5e56c95b64681d147a1

func HexUint16 added in v6.7.1

func HexUint16() string

HexUint16 will generate a random uint16 hex value with "0x" prefix

Example
Seed(11)
fmt.Println(HexUint16())
Output:

0x8754

func HexUint256 added in v6.7.1

func HexUint256() string

HexUint256 will generate a random uint256 hex value with "0x" prefix

Example
Seed(11)
fmt.Println(HexUint256())
Output:

0x875469578e51b5e56c95b64681d147a12cde48a4f417231b0c486abbc263e48d

func HexUint32 added in v6.7.1

func HexUint32() string

HexUint32 will generate a random uint32 hex value with "0x" prefix

Example
Seed(11)
fmt.Println(HexUint32())
Output:

0x87546957

func HexUint64 added in v6.7.1

func HexUint64() string

HexUint64 will generate a random uint64 hex value with "0x" prefix

Example
Seed(11)
fmt.Println(HexUint64())
Output:

0x875469578e51b5e5

func HexUint8 added in v6.7.1

func HexUint8() string

HexUint8 will generate a random uint8 hex value with "0x" prefix

Example
Seed(11)
fmt.Println(HexUint8())
Output:

0x87

func HipsterParagraph

func HipsterParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string

HipsterParagraph will generate a random paragraphGenerator Set Paragraph Count Set Sentence Count Set Word Count Set Paragraph Separator

Example
Seed(11)
fmt.Println(HipsterParagraph(3, 5, 12, "\n"))
Output:

Microdosing roof chia echo pickled meditation cold-pressed raw denim fingerstache normcore sriracha pork belly. Wolf try-hard pop-up blog tilde hashtag health butcher waistcoat paleo portland vinegar. Microdosing sartorial blue bottle slow-carb freegan five dollar toast you probably haven't heard of them asymmetrical chia farm-to-table narwhal banjo. Gluten-free blog authentic literally synth vinyl meh ethical health fixie banh mi Yuccie. Try-hard drinking squid seitan cray VHS echo chillwave hammock kombucha food truck sustainable.
Pug bushwick hella tote bag cliche direct trade waistcoat yr waistcoat knausgaard pour-over master. Pitchfork jean shorts franzen flexitarian distillery hella meggings austin knausgaard crucifix wolf heirloom. Crucifix food truck you probably haven't heard of them trust fund fixie gentrify pitchfork stumptown mlkshk umami chambray blue bottle. 3 wolf moon swag +1 biodiesel knausgaard semiotics taxidermy meh artisan hoodie +1 blue bottle. Fashion axe forage mixtape Thundercats pork belly whatever 90's beard selfies chambray cred mlkshk.
Shabby chic typewriter VHS readymade lo-fi bitters PBR&B gentrify lomo raw denim freegan put a bird on it. Raw denim cliche dreamcatcher pug fixie park trust fund migas fingerstache sriracha +1 mustache. Tilde shoreditch kickstarter franzen dreamcatcher green juice mustache neutra polaroid stumptown organic schlitz. Flexitarian ramps chicharrones kogi lo-fi mustache tilde forage street church-key williamsburg taxidermy. Chia mustache plaid mumblecore squid slow-carb disrupt Thundercats goth shoreditch master direct trade.

func HipsterSentence

func HipsterSentence(wordCount int) string

HipsterSentence will generate a random sentence

Example
Seed(11)
fmt.Println(HipsterSentence(5))
Output:

Microdosing roof chia echo pickled.

func HipsterWord

func HipsterWord() string

HipsterWord will return a single hipster word

Example
Seed(11)
fmt.Println(HipsterWord())
Output:

microdosing

func Hobby added in v6.12.2

func Hobby() string

Hobby will generate a random hobby string

Example
Seed(11)
fmt.Println(Hobby())
Output:

Transit map collecting

func Hour

func Hour() int

Hour will generate a random hour - in military time

Example
Seed(11)
fmt.Println(Hour())
Output:

17

func IPv4Address

func IPv4Address() string

IPv4Address will generate a random version 4 ip address

Example
Seed(11)
fmt.Println(IPv4Address())
Output:

152.23.53.100

func IPv6Address

func IPv6Address() string

IPv6Address will generate a random version 6 ip address

Example
Seed(11)
fmt.Println(IPv6Address())
Output:

8898:ee17:bc35:9064:5866:d019:3b95:7857

func Image

func Image(width int, height int) *img.RGBA

Image generates a random rgba image

Example
Seed(11)
fmt.Println(Image(1, 1))
Output:

&{[89 176 195 255] 4 (0,0)-(1,1)}

func ImageJpeg

func ImageJpeg(width int, height int) []byte

ImageJpeg generates a random rgba jpeg image

Example
Seed(11)
fmt.Println(ImageJpeg(1, 1))
Output:

[255 216 255 219 0 132 0 8 6 6 7 6 5 8 7 7 7 9 9 8 10 12 20 13 12 11 11 12 25 18 19 15 20 29 26 31 30 29 26 28 28 32 36 46 39 32 34 44 35 28 28 40 55 41 44 48 49 52 52 52 31 39 57 61 56 50 60 46 51 52 50 1 9 9 9 12 11 12 24 13 13 24 50 33 28 33 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 255 192 0 17 8 0 1 0 1 3 1 34 0 2 17 1 3 17 1 255 196 1 162 0 0 1 5 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 16 0 2 1 3 3 2 4 3 5 5 4 4 0 0 1 125 1 2 3 0 4 17 5 18 33 49 65 6 19 81 97 7 34 113 20 50 129 145 161 8 35 66 177 193 21 82 209 240 36 51 98 114 130 9 10 22 23 24 25 26 37 38 39 40 41 42 52 53 54 55 56 57 58 67 68 69 70 71 72 73 74 83 84 85 86 87 88 89 90 99 100 101 102 103 104 105 106 115 116 117 118 119 120 121 122 131 132 133 134 135 136 137 138 146 147 148 149 150 151 152 153 154 162 163 164 165 166 167 168 169 170 178 179 180 181 182 183 184 185 186 194 195 196 197 198 199 200 201 202 210 211 212 213 214 215 216 217 218 225 226 227 228 229 230 231 232 233 234 241 242 243 244 245 246 247 248 249 250 1 0 3 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 17 0 2 1 2 4 4 3 4 7 5 4 4 0 1 2 119 0 1 2 3 17 4 5 33 49 6 18 65 81 7 97 113 19 34 50 129 8 20 66 145 161 177 193 9 35 51 82 240 21 98 114 209 10 22 36 52 225 37 241 23 24 25 26 38 39 40 41 42 53 54 55 56 57 58 67 68 69 70 71 72 73 74 83 84 85 86 87 88 89 90 99 100 101 102 103 104 105 106 115 116 117 118 119 120 121 122 130 131 132 133 134 135 136 137 138 146 147 148 149 150 151 152 153 154 162 163 164 165 166 167 168 169 170 178 179 180 181 182 183 184 185 186 194 195 196 197 198 199 200 201 202 210 211 212 213 214 215 216 217 218 226 227 228 229 230 231 232 233 234 242 243 244 245 246 247 248 249 250 255 218 0 12 3 1 0 2 17 3 17 0 63 0 216 162 138 43 213 62 92 255 217]

func ImagePng

func ImagePng(width int, height int) []byte

ImagePng generates a random rgba png image

Example
Seed(11)
fmt.Println(ImagePng(1, 1))
Output:

[137 80 78 71 13 10 26 10 0 0 0 13 73 72 68 82 0 0 0 1 0 0 0 1 8 2 0 0 0 144 119 83 222 0 0 0 16 73 68 65 84 120 156 98 138 220 112 24 16 0 0 255 255 3 58 1 207 38 214 44 234 0 0 0 0 73 69 78 68 174 66 96 130]

func ImageURL

func ImageURL(width int, height int) string

ImageURL will generate a random Image Based Upon Height And Width. https://picsum.photos/

Example
Seed(11)
fmt.Println(ImageURL(640, 480))
Output:

https://picsum.photos/640/480

func InputName added in v6.20.0

func InputName() string

InputName will return a random input field name

Example
Seed(11)
fmt.Println(InputName())
Output:

message

func Int16

func Int16() int16

Int16 will generate a random int16 value

Example
Seed(11)
fmt.Println(Int16())
Output:

-29607

func Int32

func Int32() int32

Int32 will generate a random int32 value

Example
Seed(11)
fmt.Println(Int32())
Output:

-1072427943

func Int64

func Int64() int64

Int64 will generate a random int64 value

Example
Seed(11)
fmt.Println(Int64())
Output:

-8379641344161477543

func Int8

func Int8() int8

Int8 will generate a random Int8 value

Example
Seed(11)
fmt.Println(Int8())
Output:

-39

func IntRange added in v6.10.0

func IntRange(min, max int) int

IntRange will generate a random int value between min and max

Example
Seed(11)
fmt.Println(IntRange(1, 10))
Output:

6

func Interjection added in v6.28.0

func Interjection() string

Interjection will generate a random word expressing emotion

Example
Seed(11)
fmt.Println(Interjection())
Output:

wow

func Isin added in v6.21.0

func Isin() string

ISIN

Example

ISIN Tests

Seed(11)
fmt.Println(Isin())
Output:

CVLRQCZBXQ97

func JSON

func JSON(jo *JSONOptions) ([]byte, error)

JSON generates an object or an array of objects in json format. A nil JSONOptions returns a randomly structured JSON.

Example (Array)
Seed(11)

value, err := JSON(&JSONOptions{
	Type: "array",
	Fields: []Field{
		{Name: "id", Function: "autoincrement"},
		{Name: "first_name", Function: "firstname"},
		{Name: "last_name", Function: "lastname"},
		{Name: "password", Function: "password", Params: MapParams{"special": {"false"}}},
	},
	RowCount: 3,
	Indent:   true,
})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

[
    {
        "id": 1,
        "first_name": "Markus",
        "last_name": "Moen",
        "password": "856Y5wPZevX9"
    },
    {
        "id": 2,
        "first_name": "Jalon",
        "last_name": "Rolfson",
        "password": "64wz4EAS0Hl0"
    },
    {
        "id": 3,
        "first_name": "Nestor",
        "last_name": "Harris",
        "password": "14GKq1j7Lx4T"
    }
]
Example (NumberWithTag)
Seed(10)

type J struct {
	FieldNumber  json.Number `fake:"number:3,7"`
	FieldInt8    json.Number `fake:"int8"`
	FieldInt16   json.Number `fake:"int16"`
	FieldInt32   json.Number `fake:"int32"`
	FieldInt64   json.Number `fake:"int64"`
	FieldUint8   json.Number `fake:"uint8"`
	FieldUint16  json.Number `fake:"uint16"`
	FieldUint32  json.Number `fake:"uint32"`
	FieldUint64  json.Number `fake:"uint64"`
	FieldFloat32 json.Number `fake:"float32"`
	FieldFloat64 json.Number `fake:"float64range:12,72"`
}

var obj J
Struct(&obj)

fmt.Printf("obj.FieldNumber = %+v\n", obj.FieldNumber)
fmt.Printf("obj.FieldInt8 = %+v\n", obj.FieldInt8)
fmt.Printf("obj.FieldInt16 = %+v\n", obj.FieldInt16)
fmt.Printf("obj.FieldInt32 = %+v\n", obj.FieldInt32)
fmt.Printf("obj.FieldInt64 = %+v\n", obj.FieldInt64)
fmt.Printf("obj.FieldUint8 = %+v\n", obj.FieldUint8)
fmt.Printf("obj.FieldUint16 = %+v\n", obj.FieldUint16)
fmt.Printf("obj.FieldUint32 = %+v\n", obj.FieldUint32)
fmt.Printf("obj.FieldUint64 = %+v\n", obj.FieldUint64)
fmt.Printf("obj.FieldFloat32 = %+v\n", obj.FieldFloat32)
fmt.Printf("obj.FieldFloat64 = %+v\n", obj.FieldFloat64)
Output:

obj.FieldNumber = 3
obj.FieldInt8 = 16
obj.FieldInt16 = 10619
obj.FieldInt32 = -1654523813
obj.FieldInt64 = -4710905755560118665
obj.FieldUint8 = 200
obj.FieldUint16 = 28555
obj.FieldUint32 = 162876094
obj.FieldUint64 = 7956601014869229133
obj.FieldFloat32 = 9227009415507442000000000000000000000
obj.FieldFloat64 = 62.323882731848215
Example (Object)
Seed(11)

value, err := JSON(&JSONOptions{
	Type: "object",
	Fields: []Field{
		{Name: "first_name", Function: "firstname"},
		{Name: "last_name", Function: "lastname"},
		{Name: "address", Function: "address"},
		{Name: "password", Function: "password", Params: MapParams{"special": {"false"}}},
	},
	Indent: true,
})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

{
    "first_name": "Markus",
    "last_name": "Moen",
    "address": {
        "address": "4599 Daleton, Norfolk, New Jersey 36906",
        "street": "4599 Daleton",
        "city": "Norfolk",
        "state": "New Jersey",
        "zip": "36906",
        "country": "Tokelau",
        "latitude": 23.058758,
        "longitude": 89.022594
    },
    "password": "myZ1PgF9ThVL"
}

func JobDescriptor

func JobDescriptor() string

JobDescriptor will generate a random job descriptor string

Example
Seed(11)
fmt.Println(JobDescriptor())
Output:

Central

func JobLevel

func JobLevel() string

JobLevel will generate a random job level string

Example
Seed(11)
fmt.Println(JobLevel())
Output:

Assurance

func JobTitle

func JobTitle() string

JobTitle will generate a random job title string

Example
Seed(11)
fmt.Println(JobTitle())
Output:

Director

func Language

func Language() string

Language will return a random language

Example
Seed(11)
fmt.Println(Language())
Output:

Kazakh

func LanguageAbbreviation

func LanguageAbbreviation() string

LanguageAbbreviation will return a random language abbreviation

Example
Seed(11)
fmt.Println(LanguageAbbreviation())
Output:

kk

func LanguageBCP added in v6.7.0

func LanguageBCP() string

LanguageBCP will return a random language BCP (Best Current Practices)

Example
Seed(11)
fmt.Println(LanguageBCP())
Output:

de-DE

func LastName

func LastName() string

LastName will generate a random last name

Example
Seed(11)
fmt.Println(LastName())
Output:

Daniel

func Latitude

func Latitude() float64

Latitude will generate a random latitude float64

Example
Seed(11)
fmt.Println(Latitude())
Output:

-73.534057

func LatitudeInRange

func LatitudeInRange(min, max float64) (float64, error)

LatitudeInRange will generate a random latitude within the input range

Example
Seed(11)
lat, _ := LatitudeInRange(21, 42)
fmt.Println(lat)
Output:

22.921026

func Letter

func Letter() string

Letter will generate a single random lower case ASCII letter

Example
Seed(11)
fmt.Println(Letter())
Output:

g

func LetterN

func LetterN(n uint) string

LetterN will generate a random ASCII string with length N. Note that this function returns a string with a length of 1 when 0 is passed.

Example
Seed(11)
fmt.Println(LetterN(10))
Output:

gbRMaRxHki

func Lexify

func Lexify(str string) string

Lexify will replace ? with random generated letters

Example
Seed(11)
fmt.Println(Lexify("?????"))
Output:

gbRMa

func LogLevel

func LogLevel(logType string) string

LogLevel will generate a random log level See data/LogLevels for list of available levels

Example
Seed(11)
fmt.Println(LogLevel("")) // This will also use general
fmt.Println(LogLevel("syslog"))
fmt.Println(LogLevel("apache"))
Output:

error
debug
trace1-8

func Longitude

func Longitude() float64

Longitude will generate a random longitude float64

Example
Seed(11)
fmt.Println(Longitude())
Output:

-147.068113

func LongitudeInRange

func LongitudeInRange(min, max float64) (float64, error)

LongitudeInRange will generate a random longitude within the input range

Example
Seed(11)
long, _ := LongitudeInRange(-10, 10)
fmt.Println(long)
Output:

-8.170451

func LoremIpsumParagraph

func LoremIpsumParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string

LoremIpsumParagraph will generate a random paragraphGenerator

Example
Seed(11)
fmt.Println(LoremIpsumParagraph(3, 5, 12, "\n"))
Output:

Quia quae repellat consequatur quidem nisi quo qui voluptatum accusantium quisquam amet. Quas et ut non dolorem ipsam aut enim assumenda mollitia harum ut. Dicta similique veniam nulla voluptas at excepturi non ad maxime at non. Eaque hic repellat praesentium voluptatem qui consequuntur dolor iusto autem velit aut. Fugit tempore exercitationem harum consequatur voluptatum modi minima aut eaque et et.
Aut ea voluptatem dignissimos expedita odit tempore quod aut beatae ipsam iste. Minus voluptatibus dolorem maiores eius sed nihil vel enim odio voluptatem accusamus. Natus quibusdam temporibus tenetur cumque sint necessitatibus dolorem ex ducimus iusto ex. Voluptatem neque dicta explicabo officiis et ducimus sit ut ut praesentium pariatur. Illum molestias nisi at dolore ut voluptatem accusantium et fugiat et ut.
Explicabo incidunt reprehenderit non quia dignissimos recusandae vitae soluta quia et quia. Aut veniam voluptas consequatur placeat sapiente non eveniet voluptatibus magni velit eum. Nobis vel repellendus sed est qui autem laudantium quidem quam ullam consequatur. Aut iusto ut commodi similique quae voluptatem atque qui fugiat eum aut. Quis distinctio consequatur voluptatem vel aliquid aut laborum facere officiis iure tempora.

func LoremIpsumSentence

func LoremIpsumSentence(wordCount int) string

LoremIpsumSentence will generate a random sentence

Example
Seed(11)
fmt.Println(LoremIpsumSentence(5))
Output:

Quia quae repellat consequatur quidem.

func LoremIpsumWord

func LoremIpsumWord() string

LoremIpsumWord will generate a random word

Example
Seed(11)
fmt.Println(LoremIpsumWord())
Output:

quia

func Lunch

func Lunch() string

Lunch will return a random lunch name

Example
Seed(11)
fmt.Println(Lunch())
Output:

No bake hersheys bar pie

func MacAddress

func MacAddress() string

MacAddress will generate a random mac address

Example
Seed(11)
fmt.Println(MacAddress())
Output:

e1:74:cb:01:77:91

func Map

func Map() map[string]any

Map will generate a random set of map data

Example
Seed(11)
fmt.Println(Map())
Output:

map[here:Manager herself:map[trip:[far computer was unless whom riches]] how:8504801 ouch:Keith Ullrich outstanding:1860846 that:web services]

func Markdown added in v6.25.0

func Markdown(co *MarkdownOptions) (string, error)

Markdown will return a single random Markdown template document

Example

TemplateMarkdown examples and tests

Seed(11)

value, err := Markdown(&MarkdownOptions{})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

	# PurpleSheep5

*Author: Amie Feil*

Was by army party riches theirs instead. Here mine whichever that those instance growth. Has ouch enough Swiss us since down. He she aha us you to upon. How this this furniture way no play.

Towel that us to accordingly theirs purse. Enough so though election often until eek. Weekly yet oops until conclude his stay. Elsewhere such that galaxy clean that last. Each stack reluctantly theirs wisp aid firstly.

## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

## Installation
'''bash
pip install PurpleSheep5
'''

## Usage
'''python
result = purplesheep5.process("funny request")
print("purplesheep5 result:", "in progress")
'''

## License
MIT

func MiddleName added in v6.22.0

func MiddleName() string

MiddleName will generate a random middle name

Example
Seed(11)
fmt.Println(MiddleName())
Output:

Belinda

func MinecraftAnimal added in v6.11.0

func MinecraftAnimal() string

MinecraftAnimal will generate a random Minecraft animal

Example
Seed(11)
fmt.Println(MinecraftAnimal())
Output:

chicken

func MinecraftArmorPart added in v6.11.0

func MinecraftArmorPart() string

MinecraftArmorPart will generate a random Minecraft armor part

Example
Seed(11)
fmt.Println(MinecraftArmorPart())
Output:

helmet

func MinecraftArmorTier added in v6.11.0

func MinecraftArmorTier() string

MinecraftArmorTier will generate a random Minecraft armor tier

Example
Seed(11)
fmt.Println(MinecraftArmorTier())
Output:

leather

func MinecraftBiome added in v6.11.0

func MinecraftBiome() string

MinecraftBiome will generate a random Minecraft biome

Example
Seed(11)
fmt.Println(MinecraftBiome())
Output:

stone shore

func MinecraftDye added in v6.11.0

func MinecraftDye() string

MinecraftDye will generate a random Minecraft dye

Example
Seed(11)
fmt.Println(MinecraftDye())
Output:

light gray

func MinecraftFood added in v6.11.0

func MinecraftFood() string

MinecraftFood will generate a random Minecraft food

Example
Seed(11)
fmt.Println(MinecraftFood())
Output:

beetroot

func MinecraftMobBoss added in v6.11.0

func MinecraftMobBoss() string

MinecraftMobBoss will generate a random Minecraft mob boss

Example
Seed(11)
fmt.Println(MinecraftMobBoss())
Output:

ender dragon

func MinecraftMobHostile added in v6.11.0

func MinecraftMobHostile() string

MinecraftMobHostile will generate a random Minecraft mob hostile

Example
Seed(11)
fmt.Println(MinecraftMobHostile())
Output:

blaze

func MinecraftMobNeutral added in v6.11.0

func MinecraftMobNeutral() string

MinecraftMobNeutral will generate a random Minecraft mob neutral

Example
Seed(11)
fmt.Println(MinecraftMobNeutral())
Output:

wolf

func MinecraftMobPassive added in v6.11.0

func MinecraftMobPassive() string

MinecraftMobPassive will generate a random Minecraft mob passive

Example
Seed(11)
fmt.Println(MinecraftMobPassive())
Output:

chicken

func MinecraftOre added in v6.11.0

func MinecraftOre() string

MinecraftOre will generate a random Minecraft ore

Example
Seed(11)
fmt.Println(MinecraftOre())
Output:

coal

func MinecraftTool added in v6.11.0

func MinecraftTool() string

MinecraftTool will generate a random Minecraft tool

Example
Seed(11)
fmt.Println(MinecraftTool())
Output:

pickaxe

func MinecraftVillagerJob added in v6.11.0

func MinecraftVillagerJob() string

MinecraftVillagerJob will generate a random Minecraft villager job

Example
Seed(11)
fmt.Println(MinecraftVillagerJob())
Output:

toolsmith

func MinecraftVillagerLevel added in v6.11.0

func MinecraftVillagerLevel() string

MinecraftVillagerLevel will generate a random Minecraft villager level

Example
Seed(11)
fmt.Println(MinecraftVillagerLevel())
Output:

novice

func MinecraftVillagerStation added in v6.11.0

func MinecraftVillagerStation() string

MinecraftVillagerStation will generate a random Minecraft villager station

Example
Seed(11)
fmt.Println(MinecraftVillagerStation())
Output:

cauldron

func MinecraftWeapon added in v6.11.0

func MinecraftWeapon() string

MinecraftWeapon will generate a random Minecraft weapon

Example
Seed(11)
fmt.Println(MinecraftWeapon())
Output:

sword

func MinecraftWeather added in v6.11.0

func MinecraftWeather() string

MinecraftWeather will generate a random Minecraft weather

Example
Seed(11)
fmt.Println(MinecraftWeather())
Output:

clear

func MinecraftWood added in v6.11.0

func MinecraftWood() string

MinecraftWood will generate a random Minecraft wood

Example
Seed(11)
fmt.Println(MinecraftWood())
Output:

oak

func Minute

func Minute() int

Minute will generate a random minute

Example
Seed(11)
fmt.Println(Minute())
Output:

5

func Month

func Month() int

Month will generate a random month int

Example
Seed(11)
fmt.Println(Month())
Output:

6

func MonthString added in v6.3.0

func MonthString() string

MonthString will generate a random month string

Example
Seed(11)
fmt.Println(MonthString())
Output:

June

func MovieGenre added in v6.22.0

func MovieGenre() string
Example
Seed(11)
fmt.Println(MovieGenre())
Output:

Music

func MovieName added in v6.22.0

func MovieName() string
Example
Seed(11)
fmt.Println(MovieName())
Output:

Psycho

func Name

func Name() string

Name will generate a random First and Last Name

Example
Seed(11)
fmt.Println(Name())
Output:

Markus Moen

func NamePrefix

func NamePrefix() string

NamePrefix will generate a random name prefix

Example
Seed(11)
fmt.Println(NamePrefix())
Output:

Mr.

func NameSuffix

func NameSuffix() string

NameSuffix will generate a random name suffix

Example
Seed(11)
fmt.Println(NameSuffix())
Output:

Jr.

func NanoSecond

func NanoSecond() int

NanoSecond will generate a random nano second

Example
Seed(11)
fmt.Println(NanoSecond())
Output:

693298265

func NiceColors added in v6.20.0

func NiceColors() []string

NiceColor will generate a random safe color string

Example
Seed(11)
fmt.Println(NiceColors())
Output:

[#f6f6f6 #e8e8e8 #333333 #990100 #b90504]

func Noun

func Noun() string

Noun will generate a random noun

Example
Seed(11)
fmt.Println(Noun())
Output:

aunt

func NounAbstract added in v6.11.0

func NounAbstract() string

NounAbstract will generate a random abstract noun

Example
Seed(11)
fmt.Println(NounAbstract())
Output:

confusion

func NounCollectiveAnimal added in v6.11.0

func NounCollectiveAnimal() string

NounCollectiveAnimal will generate a random collective noun animal

Example
Seed(11)
fmt.Println(NounCollectiveAnimal())
Output:

party

func NounCollectivePeople added in v6.11.0

func NounCollectivePeople() string

NounCollectivePeople will generate a random collective noun person

Example
Seed(11)
fmt.Println(NounCollectivePeople())
Output:

body

func NounCollectiveThing added in v6.11.0

func NounCollectiveThing() string

NounCollectiveThing will generate a random collective noun thing

Example
Seed(11)
fmt.Println(NounCollectiveThing())
Output:

hand

func NounCommon added in v6.11.0

func NounCommon() string

NounCommon will generate a random common noun

Example
Seed(11)
fmt.Println(NounCommon())
Output:

part

func NounConcrete added in v6.11.0

func NounConcrete() string

NounConcrete will generate a random concrete noun

Example
Seed(11)
fmt.Println(NounConcrete())
Output:

snowman

func NounCountable added in v6.11.0

func NounCountable() string

NounCountable will generate a random countable noun

Example
Seed(11)
fmt.Println(NounCountable())
Output:

neck

func NounDeterminer added in v6.28.0

func NounDeterminer() string

NounDeterminer will generate a random noun determiner

Example
Seed(11)
fmt.Println(NounDeterminer())
Output:

an

func NounProper added in v6.11.0

func NounProper() string

NounProper will generate a random proper noun

Example
Seed(11)
fmt.Println(NounProper())
Output:

Marcel

func NounUncountable added in v6.11.0

func NounUncountable() string

NounUncountable will generate a random uncountable noun

Example
Seed(11)
fmt.Println(NounUncountable())
Output:

seafood

func Number

func Number(min int, max int) int

Number will generate a random number between given min And max

Example
Seed(11)
fmt.Println(Number(50, 23456))
Output:

12583

func Numerify

func Numerify(str string) string

Numerify will replace # with random numerical values

Example
Seed(11)
fmt.Println(Numerify("###-###-####"))
Output:

613-645-9948

func OperaUserAgent

func OperaUserAgent() string

OperaUserAgent will generate a random opera browser user agent string

Example
Seed(11)
fmt.Println(OperaUserAgent())
Output:

Opera/8.20 (Macintosh; U; PPC Mac OS X 10_9_10; en-US) Presto/2.9.198 Version/11.00

func Paragraph

func Paragraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string

Paragraph will generate a random paragraphGenerator

Example
Seed(11)
fmt.Println(Paragraph(3, 5, 12, "\n"))
Output:

None how these keep trip Congolese choir computer still far unless army. Party riches theirs instead here mine whichever that those instance growth has. Ouch enough Swiss us since down he she aha us you to. Upon how this this furniture way no play towel that us to. Accordingly theirs purse enough so though election often until eek weekly yet.
Oops until conclude his stay elsewhere such that galaxy clean that last. Each stack reluctantly theirs wisp aid firstly highly butter accordingly should already. Calm shake according fade neither kuban upon this he fortnightly occasionally bunch. On who elsewhere lastly hourly right there honesty we is how result. Out Shakespearean have whom yearly another packet are behind late lot finally.
Time themselves goodness quizzical our therefore could fact cackle yourselves zebra for. Whose enormously all bowl out wandering secondly yellow another your hourly spit. Since tomorrow hers words little think will our by Polynesian write much. Of herself uptight these composer these any firstly stack you much terribly. Over pose place sprint it child is joyously that I whom mango.

func Password

func Password(lower bool, upper bool, numeric bool, special bool, space bool, num int) string

Password will generate a random password. Minimum number length of 5 if less than.

Example
Seed(11)
fmt.Println(Password(true, false, false, false, false, 32))
fmt.Println(Password(false, true, false, false, false, 32))
fmt.Println(Password(false, false, true, false, false, 32))
fmt.Println(Password(false, false, false, true, false, 32))
fmt.Println(Password(true, true, true, true, true, 32))
fmt.Println(Password(true, true, true, true, true, 4))
Output:

vodnqxzsuptgehrzylximvylxzoywexw
ZSRQWJFJWCSTVGXKYKWMLIAFGFELFJRG
61718615932495608398906260648432
!*&#$$??_!&!#.@@-!_!!$$-?_$&.@-&
d6UzSwXvJ81 7QPvlse@l ln VmvU5jd
UKTn2

func PastDate added in v6.27.0

func PastDate() time.Time

FutureDate will generate a random past time.Time struct

Example
Seed(11)
fmt.Println(PastDate())
Output:

func PetName

func PetName() string

PetName will return a random fun pet name

Example
Seed(11)
fmt.Println(PetName())
Output:

Ozzy Pawsborne

func Phone

func Phone() string

Phone will generate a random phone number string

Example
Seed(11)
fmt.Println(Phone())
Output:

6136459948

func PhoneFormatted

func PhoneFormatted() string

PhoneFormatted will generate a random phone number string

Example
Seed(11)
fmt.Println(PhoneFormatted())
Output:

136-459-9489

func Phrase

func Phrase() string

Phrase will return a random phrase

Example
Seed(11)
fmt.Println(Phrase())
Output:

horses for courses

func PhraseAdverb added in v6.11.0

func PhraseAdverb() string

PhraseAdverb will return a random adverb phrase

Example
Seed(11)
fmt.Println(PhraseAdverb())
Output:

fully gladly

func PhraseNoun added in v6.11.0

func PhraseNoun() string

PhraseNoun will return a random noun phrase

Example
Seed(11)
fmt.Println(PhraseNoun())
Output:

the purple tribe

func PhrasePreposition added in v6.11.0

func PhrasePreposition() string

PhrasePreposition will return a random preposition phrase

Example
Seed(11)
fmt.Println(PhrasePreposition())
Output:

out the tribe

func PhraseVerb added in v6.11.0

func PhraseVerb() string

PhraseVerb will return a random preposition phrase

Example
Seed(11)
fmt.Println(PhraseVerb())
Output:

gladly dream indeed swiftly till a problem poorly

func Preposition

func Preposition() string

Preposition will generate a random preposition

Example
Seed(11)
fmt.Println(Preposition())
Output:

other than

func PrepositionCompound added in v6.11.0

func PrepositionCompound() string

PrepositionCompound will generate a random compound preposition

Example
Seed(11)
fmt.Println(PrepositionCompound())
Output:

according to

func PrepositionDouble added in v6.11.0

func PrepositionDouble() string

PrepositionDouble will generate a random double preposition

Example
Seed(11)
fmt.Println(PrepositionDouble())
Output:

before

func PrepositionSimple added in v6.11.0

func PrepositionSimple() string

PrepositionSimple will generate a random simple preposition

Example
Seed(11)
fmt.Println(PrepositionSimple())
Output:

out

func Price

func Price(min, max float64) float64

Price will take in a min and max value and return a formatted price

Example
Seed(11)
fmt.Printf("%.2f", Price(0.8618, 1000))
Output:

92.26

func ProductCategory added in v6.26.0

func ProductCategory() string

ProductCategory will generate a random product category

Example
Seed(11)
fmt.Println(ProductCategory())
Output:

pet supplies

func ProductDescription added in v6.26.0

func ProductDescription() string

ProductDescription will generate a random product description

Example
Seed(11)
fmt.Println(ProductDescription())
Output:

How these keep trip Congolese choir computer still far unless army party riches theirs instead. Mine whichever that those instance. Has ouch enough Swiss us since down.

func ProductFeature added in v6.26.0

func ProductFeature() string

ProductFeature will generate a random product feature

Example
Seed(11)
fmt.Println(ProductFeature())
Output:

wireless

func ProductMaterial added in v6.26.0

func ProductMaterial() string

ProductMaterial will generate a random product material

Example
Seed(11)
fmt.Println(ProductMaterial())
Output:

silicon

func ProductName added in v6.26.0

func ProductName() string

ProductName will generate a random product name

Example
Seed(11)
fmt.Println(ProductName())
Output:

Appliance Pulse Leather

func ProductUPC added in v6.26.0

func ProductUPC() string

ProductUPC will generate a random product UPC

Example
Seed(11)
fmt.Println(ProductUPC())
Output:

056990598130

func ProgrammingLanguage

func ProgrammingLanguage() string

ProgrammingLanguage will return a random programming language

Example
Seed(464)
fmt.Println(ProgrammingLanguage())
Output:

Go

func ProgrammingLanguageBest

func ProgrammingLanguageBest() string

ProgrammingLanguageBest will return a random programming language

Example
Seed(11)
fmt.Println(ProgrammingLanguageBest())
Output:

Go

func Pronoun added in v6.11.0

func Pronoun() string

Pronoun will generate a random pronoun

Example
Seed(11)
fmt.Println(Pronoun())
Output:

me

func PronounDemonstrative added in v6.11.0

func PronounDemonstrative() string

PronounDemonstrative will generate a random demonstrative pronoun

Example
Seed(11)
fmt.Println(PronounDemonstrative())
Output:

this

func PronounIndefinite added in v6.11.0

func PronounIndefinite() string

PronounIndefinite will generate a random indefinite pronoun

Example
Seed(11)
fmt.Println(PronounIndefinite())
Output:

few

func PronounInterrogative added in v6.11.0

func PronounInterrogative() string

PronounInterrogative will generate a random interrogative pronoun

Example
Seed(11)
fmt.Println(PronounInterrogative())
Output:

what

func PronounObject added in v6.11.0

func PronounObject() string

PronounObject will generate a random object pronoun

Example
Seed(11)
fmt.Println(PronounObject())
Output:

it

func PronounPersonal added in v6.11.0

func PronounPersonal() string

PronounPersonal will generate a random personal pronoun

Example
Seed(11)
fmt.Println(PronounPersonal())
Output:

it

func PronounPossessive added in v6.11.0

func PronounPossessive() string

PronounPossessive will generate a random possessive pronoun

Example
Seed(11)
fmt.Println(PronounPossessive())
Output:

mine

func PronounReflective added in v6.11.0

func PronounReflective() string

PronounReflective will generate a random reflective pronoun

Example
Seed(11)
fmt.Println(PronounReflective())
Output:

myself

func PronounRelative added in v6.11.0

func PronounRelative() string

PronounRelative will generate a random relative pronoun

Example
Seed(11)
fmt.Println(PronounRelative())
Output:

as

func Question

func Question() string

Question will return a random question

Example
Seed(11)
fmt.Println(Question())
Output:

Roof chia echo pickled?

func Quote

func Quote() string

Quote will return a random quote from a random person

Example
Seed(11)
fmt.Println(Quote())
Output:

"Roof chia echo pickled." - Marques Jakubowski

func RGBColor

func RGBColor() []int

RGBColor will generate a random int slice color

Example
Seed(11)
fmt.Println(RGBColor())
Output:

[89 176 195]

func RandomInt

func RandomInt(i []int) int

RandomInt will take in a slice of int and return a randomly selected value

Example
Seed(11)

ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657}
fmt.Println(RandomInt(ints))
Output:

52

func RandomMapKey added in v6.11.0

func RandomMapKey(mapI any) any

RandomMapKey will return a random key from a map

func RandomString

func RandomString(a []string) string

RandomString will take in a slice of string and return a randomly selected value

Example
Seed(11)
fmt.Println(RandomString([]string{"hello", "world"}))
Output:

hello

func RandomUint

func RandomUint(u []uint) uint

RandomUint will take in a slice of uint and return a randomly selected value

Example
Seed(11)

ints := []uint{52, 854, 941, 74125, 8413, 777, 89416, 841657}
fmt.Println(RandomUint(ints))
Output:

52

func Regex

func Regex(regexStr string) string

Regex will generate a string based upon a RE2 syntax

Example
Seed(11)

fmt.Println(Regex("[abcdef]{5}"))
fmt.Println(Regex("[[:upper:]]{5}"))
fmt.Println(Regex("(hello|world|whats|up)"))
fmt.Println(Regex(`^[a-z]{5,10}@[a-z]{5,10}\.(com|net|org)$`))
Output:

affec
RXHKI
world
tapwyjdnsm@gtlxw.net

func RemoveFuncLookup

func RemoveFuncLookup(functionName string)

RemoveFuncLookup will remove a function from lookup

func SQL added in v6.16.0

func SQL(so *SQLOptions) (string, error)
Example
Seed(11)

res, _ := SQL(&SQLOptions{
	Table: "people",
	Count: 2,
	Fields: []Field{
		{Name: "id", Function: "autoincrement"},
		{Name: "first_name", Function: "firstname"},
		{Name: "price", Function: "price"},
		{Name: "age", Function: "number", Params: MapParams{"min": {"1"}, "max": {"99"}}},
		{Name: "created_at", Function: "date", Params: MapParams{"format": {"2006-01-02 15:04:05"}}},
	},
})

fmt.Println(string(res))
Output:

INSERT INTO people (id, first_name, price, age, created_at) VALUES (1, 'Markus', 804.92, 21, '1989-01-30 07:58:01'),(2, 'Santino', 235.13, 40, '1919-07-07 22:25:40');

func SSN

func SSN() string

SSN will generate a random Social Security Number

Example
Seed(11)
fmt.Println(SSN())
Output:

493298265

func SafariUserAgent

func SafariUserAgent() string

SafariUserAgent will generate a random safari browser user agent string

Example
Seed(11)
fmt.Println(SafariUserAgent())
Output:

Mozilla/5.0 (iPad; CPU OS 7_0_2 like Mac OS X; en-US) AppleWebKit/536.4.4 (KHTML, like Gecko) Version/3.0.5 Mobile/8B120 Safari/6536.4.4

func SafeColor

func SafeColor() string

SafeColor will generate a random safe color string

Example
Seed(11)
fmt.Println(SafeColor())
Output:

black

func School added in v6.25.0

func School() string

School will generate a random School type

Example
Seed(11)
fmt.Println(School())
Output:

Harborview State Academy

func Second

func Second() int

Second will generate a random second

Example
Seed(11)
fmt.Println(Second())
Output:

5

func Seed

func Seed(seed int64)

Seed will set the global random value. Setting seed to 0 will use crypto/rand

func Sentence

func Sentence(wordCount int) string

Sentence will generate a random sentence

Example
Seed(11)
fmt.Println(Sentence(5))
Output:

None how these keep trip.

func SentenceSimple added in v6.11.0

func SentenceSimple() string

SentenceSimple will generate a random simple sentence

Example
Seed(11)
fmt.Println(SentenceSimple())
Output:

The purple tribe indeed swiftly laugh.

func SetGlobalFaker

func SetGlobalFaker(faker *Faker)

SetGlobalFaker will allow you to set what type of faker is globally used. Defailt is math/rand

Example
cryptoFaker := NewCrypto()
SetGlobalFaker(cryptoFaker)
Output:

func ShuffleAnySlice

func ShuffleAnySlice(v any)

ShuffleAnySlice takes in a slice and outputs it in a random order

Example
Seed(11)

strings := []string{"happy", "times", "for", "everyone", "have", "a", "good", "day"}
ShuffleAnySlice(strings)
fmt.Println(strings)

ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657}
ShuffleAnySlice(ints)
fmt.Println(ints)
Output:

[good everyone have for times a day happy]
[777 74125 941 854 89416 52 8413 841657]

func ShuffleInts

func ShuffleInts(a []int)

ShuffleInts will randomize a slice of ints

Example
Seed(11)

ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657}
ShuffleInts(ints)
fmt.Println(ints)
Output:

[74125 777 941 89416 8413 854 52 841657]

func ShuffleStrings

func ShuffleStrings(a []string)

ShuffleStrings will randomize a slice of strings

Example
Seed(11)
strings := []string{"happy", "times", "for", "everyone", "have", "a", "good", "day"}
ShuffleStrings(strings)
fmt.Println(strings)
Output:

[good everyone have for times a day happy]

func Slice added in v6.2.0

func Slice(v any)

Slice fills built-in types and exported fields of a struct with random data.

Example
Seed(11)

var S []string
Slice(&S)

I := make([]int8, 3)
Slice(&I)

fmt.Println(S)
fmt.Println(I)
Output:

[RMaRxHkiJ PtapWYJdn MKgtlxwnq qclaYkWw oRLOPxLIok qanPAKaXS]
[-88 -101 60]
Example (Struct)
Seed(11)

type Basic struct {
	S string `fake:"{firstname}"`
	I int
	F float32
}

var B []Basic
Slice(&B)

fmt.Println(B)
Output:

[{Marcel -1697368647228132669 1.9343967e+38} {Lura 1052100795806789315 2.670526e+38} {Lucinda 4409580151121052361 1.0427679e+38} {Santino 2168696190310795206 2.2573786e+38} {Dawn 3859340644268985534 4.249854e+37} {Alice 9082579350789565885 1.0573345e+38}]

func Slogan added in v6.22.0

func Slogan() string

Slogan will generate a random company slogan

Example
Seed(11)
fmt.Println(Slogan())
Output:

Universal seamless Focus, interactive.

func Snack

func Snack() string

Snack will return a random snack name

Example
Seed(11)
fmt.Println(Snack())
Output:

Hoisin marinated wing pieces

func State

func State() string

State will generate a random state string

Example
Seed(11)
fmt.Println(State())
Output:

Hawaii

func StateAbr

func StateAbr() string

StateAbr will generate a random abbreviated state string

Example
Seed(11)
fmt.Println(StateAbr())
Output:

CO

func Street

func Street() string

Street will generate a random address street string

Example
Seed(11)
fmt.Println(Street())
Output:

364 Unionsville

func StreetName

func StreetName() string

StreetName will generate a random address street name string

Example
Seed(11)
fmt.Println(StreetName())
Output:

View

func StreetNumber

func StreetNumber() string

StreetNumber will generate a random address street number string

Example
Seed(11)
fmt.Println(StreetNumber())
Output:

13645

func StreetPrefix

func StreetPrefix() string

StreetPrefix will generate a random address street prefix string

Example
Seed(11)
fmt.Println(StreetPrefix())
Output:

Lake

func StreetSuffix

func StreetSuffix() string

StreetSuffix will generate a random address street suffix string

Example
Seed(11)
fmt.Println(StreetSuffix())
Output:

land

func Struct

func Struct(v any) error

Struct fills in exported fields of a struct with random data based on the value of `fake` tag of exported fields or with the result of a call to the Fake() method if the field type implements `Fakeable`. Use `fake:"skip"` to explicitly skip an element. All built-in types are supported, with templating support for string types.

Example
Seed(11)

type Bar struct {
	Name   string
	Number int
	Float  float32
}

type Foo struct {
	Str        string
	Int        int
	Pointer    *int
	Name       string            `fake:"{firstname}"`
	Number     string            `fake:"{number:1,10}"`
	Skip       *string           `fake:"skip"`
	SkipAlt    *string           `fake:"-"`
	Array      []string          `fakesize:"2"`
	ArrayRange []string          `fakesize:"2,6"`
	Map        map[string]string `fakesize:"2"`
	MapRange   map[string]string `fakesize:"2,4"`
	Bar        Bar
}

var f Foo
Struct(&f)

fmt.Printf("%s\n", f.Str)
fmt.Printf("%d\n", f.Int)
fmt.Printf("%d\n", *f.Pointer)
fmt.Printf("%v\n", f.Name)
fmt.Printf("%v\n", f.Number)
fmt.Printf("%v\n", f.Skip)
fmt.Printf("%v\n", f.SkipAlt)
fmt.Printf("%v\n", f.Array)
fmt.Printf("%v\n", f.ArrayRange)
fmt.Printf("%v\n", f.Map)
fmt.Printf("%v\n", f.MapRange)
fmt.Printf("%+v\n", f.Bar)
Output:

bRMaRx
8474499440427634498
4409580151121052361
Andre
1
<nil>
<nil>
[PtapWYJdn MKgtlxwnq]
[claYk wfoRL PxLIok qanPAKaXS QFpZysVaHG]
map[DjRRGUns:xdBXGY yvqqdH:eUxcvUVS]
map[Oyrwg:LhewLkDVtD XpYcnVTKpB:eubY jQZsZt:eUpXhOq ynojqPYDrH:HWYKFgji]
{Name:ANhYxKtSH Number:-5807586752746953977 Float:4.558046e+37}
Example (Array)
Seed(11)

type Foo struct {
	Bar    string
	Int    int
	Name   string  `fake:"{firstname}"`
	Number string  `fake:"{number:1,10}"`
	Skip   *string `fake:"skip"`
}

type FooMany struct {
	Foos       []Foo    `fakesize:"1"`
	Names      []string `fake:"{firstname}" fakesize:"3"`
	NamesRange []string `fake:"{firstname}" fakesize:"3,6"`
}

var fm FooMany
Struct(&fm)

fmt.Printf("%v\n", fm.Foos)
fmt.Printf("%v\n", fm.Names)
fmt.Printf("%v\n", fm.NamesRange)
Output:

[{bRMaRx 8474499440427634498 Paolo 4 <nil>}]
[Santino Carole Enrique]
[Zachery Amie Alice Zachary]

func Svg added in v6.20.0

func Svg(options *SVGOptions) string

Generate a random svg generator

Example
Seed(11)
fmt.Println(Svg(nil))
Output:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 420 496" width="420" height="496"><rect x="0" y="0" width="100%" height="100%" fill="#4f2958" /><polygon points="382,87 418,212 415,110" fill="#fffbb7" /><polygon points="283,270 225,264 411,352" fill="#5b7c8d" /><polygon points="147,283 388,2 117,263" fill="#4f2958" /><polygon points="419,123 71,282 56,55" fill="#fffbb7" /><polygon points="54,451 377,89 52,351" fill="#66b6ab" /><polygon points="395,169 397,256 110,208" fill="#5b7c8d" /><polygon points="222,52 96,147 107,296" fill="#66b6ab" /><polygon points="126,422 57,93 43,221" fill="#fffbb7" /><polygon points="126,125 61,130 348,57" fill="#5b7c8d" /><polygon points="26,235 97,182 58,37" fill="#a6f6af" /><polygon points="190,495 407,44 53,79" fill="#66b6ab" /></svg>

func Teams

func Teams(peopleArray []string, teamsArray []string) map[string][]string

Teams takes in an array of people and team names and randomly places the people into teams as evenly as possible

Example
Seed(11)
fmt.Println(Teams(
	[]string{"Billy", "Sharon", "Jeff", "Connor", "Steve", "Justin", "Fabian", "Robert"},
	[]string{"Team 1", "Team 2", "Team 3"},
))
Output:

map[Team 1:[Fabian Connor Steve] Team 2:[Jeff Sharon Justin] Team 3:[Robert Billy]]

func Template added in v6.25.0

func Template(template string, co *TemplateOptions) (string, error)

Template generates an document based on the the supplied template

Example
Seed(11)

template := `{{range IntRange 1 4}}{{FirstName}} {{LastName}}\n{{end}}`

value, err := Template(template, &TemplateOptions{Data: 4})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

Markus Moen
Alayna Wuckert
Lura Lockman
Sylvan Mraz

func TimeZone

func TimeZone() string

TimeZone will select a random timezone string

Example
Seed(11)
fmt.Println(TimeZone())
Output:

Kaliningrad Standard Time

func TimeZoneAbv

func TimeZoneAbv() string

TimeZoneAbv will select a random timezone abbreviation string

Example
Seed(11)
fmt.Println(TimeZoneAbv())
Output:

KST

func TimeZoneFull

func TimeZoneFull() string

TimeZoneFull will select a random full timezone string

Example
Seed(11)
fmt.Println(TimeZoneFull())
Output:

(UTC+03:00) Kaliningrad, Minsk

func TimeZoneOffset

func TimeZoneOffset() float32

TimeZoneOffset will select a random timezone offset

Example
Seed(11)
fmt.Println(TimeZoneOffset())
Output:

3

func TimeZoneRegion

func TimeZoneRegion() string

TimeZoneRegion will select a random region style timezone string, e.g. "America/Chicago"

Example
Seed(11)
fmt.Println(TimeZoneRegion())
Output:

America/Vancouver

func URL

func URL() string

URL will generate a random url string

Example
Seed(11)
fmt.Println(URL())
Output:

https://www.dynamiciterate.name/target/seamless

func UUID

func UUID() string

UUID (version 4) will generate a random unique identifier based upon random numbers Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Example
Seed(11)
fmt.Println(UUID())
Output:

98173564-6619-4557-888e-65b16bb5def5

func Uint16

func Uint16() uint16

Uint16 will generate a random uint16 value

Example
Seed(11)
fmt.Println(Uint16())
Output:

34968

func Uint32

func Uint32() uint32

Uint32 will generate a random uint32 value

Example
Seed(11)
fmt.Println(Uint32())
Output:

1075055705

func Uint64

func Uint64() uint64

Uint64 will generate a random uint64 value

Example
Seed(11)
fmt.Println(Uint64())
Output:

10067102729548074073

func Uint8

func Uint8() uint8

Uint8 will generate a random uint8 value

Example
Seed(11)
fmt.Println(Uint8())
Output:

152

func UintRange added in v6.10.0

func UintRange(min, max uint) uint

UintRange will generate a random uint value between min and max

Example
Seed(11)
fmt.Println(UintRange(1, 10))
Output:

1

func UserAgent

func UserAgent() string

UserAgent will generate a random broswer user agent

Example
Seed(11)
fmt.Println(UserAgent())
Output:

Mozilla/5.0 (Windows NT 5.0) AppleWebKit/5312 (KHTML, like Gecko) Chrome/40.0.800.0 Mobile Safari/5312

func Username

func Username() string

Username will generate a random username based upon picking a random lastname and random numbers at the end

Example
Seed(11)
fmt.Println(Username())
Output:

Daniel1364

func Vegetable

func Vegetable() string

Vegetable will return a random vegetable name

Example
Seed(11)
fmt.Println(Vegetable())
Output:

Amaranth Leaves

func Verb

func Verb() string

Verb will generate a random verb

Example
Seed(11)
fmt.Println(Verb())
Output:

does

func VerbAction added in v6.11.0

func VerbAction() string

VerbAction will generate a random action verb

Example
Seed(11)
fmt.Println(VerbAction())
Output:

close

func VerbHelping added in v6.11.0

func VerbHelping() string

VerbHelping will generate a random helping verb

Example
Seed(11)
fmt.Println(VerbHelping())
Output:

be

func VerbIntransitive added in v6.11.0

func VerbIntransitive() string

VerbIntransitive will generate a random intransitive verb

Example
Seed(11)
fmt.Println(VerbIntransitive())
Output:

laugh

func VerbLinking added in v6.11.0

func VerbLinking() string

VerbLinking will generate a random linking verb

Example
Seed(11)
fmt.Println(VerbLinking())
Output:

was

func VerbTransitive added in v6.11.0

func VerbTransitive() string

VerbTransitive will generate a random transitive verb

Example
Seed(11)
fmt.Println(VerbTransitive())
Output:

follow

func Vowel added in v6.18.0

func Vowel() string

Vowel will generate a single random lower case vowel

Example
Seed(11)
fmt.Println(Vowel())
Output:

a

func WeekDay

func WeekDay() string

WeekDay will generate a random weekday string (Monday-Sunday)

Example
Seed(11)
fmt.Println(WeekDay())
Output:

Tuesday

func Weighted added in v6.1.0

func Weighted(options []any, weights []float32) (any, error)

Weighted will take in an array of options and weights and return a random selection based upon its indexed weight

Example
Seed(11)

options := []any{"hello", 2, 6.9}
weights := []float32{1, 2, 3}
option, _ := Weighted(options, weights)

fmt.Println(option)
Output:

hello

func Word

func Word() string

Word will generate a random word

Example
Seed(11)
fmt.Println(Word())
Output:

none

func XML

func XML(xo *XMLOptions) ([]byte, error)

XML generates an object or an array of objects in json format A nil XMLOptions returns a randomly structured XML.

Example (Array)
Seed(11)

value, err := XML(&XMLOptions{
	Type:          "array",
	RootElement:   "xml",
	RecordElement: "record",
	RowCount:      2,
	Indent:        true,
	Fields: []Field{
		{Name: "first_name", Function: "firstname"},
		{Name: "last_name", Function: "lastname"},
		{Name: "password", Function: "password", Params: MapParams{"special": {"false"}}},
	},
})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

<xml>
    <record>
        <first_name>Markus</first_name>
        <last_name>Moen</last_name>
        <password>856Y5wPZevX9</password>
    </record>
    <record>
        <first_name>Jalon</first_name>
        <last_name>Rolfson</last_name>
        <password>64wz4EAS0Hl0</password>
    </record>
</xml>
Example (Single)
Seed(11)

value, err := XML(&XMLOptions{
	Type:          "single",
	RootElement:   "xml",
	RecordElement: "record",
	RowCount:      2,
	Indent:        true,
	Fields: []Field{
		{Name: "first_name", Function: "firstname"},
		{Name: "last_name", Function: "lastname"},
		{Name: "password", Function: "password", Params: MapParams{"special": {"false"}}},
	},
})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

<xml>
    <first_name>Markus</first_name>
    <last_name>Moen</last_name>
    <password>856Y5wPZevX9</password>
</xml>

func Year

func Year() int

Year will generate a random year between 1900 - current year

Example
Seed(11)
fmt.Println(Year())
Output:

1915

func Zip

func Zip() string

Zip will generate a random Zip code string

Example
Seed(11)
fmt.Println(Zip())
Output:

13645

Types

type AddressInfo

type AddressInfo struct {
	Address   string  `json:"address" xml:"address"`
	Street    string  `json:"street" xml:"street"`
	City      string  `json:"city" xml:"city"`
	State     string  `json:"state" xml:"state"`
	Zip       string  `json:"zip" xml:"zip"`
	Country   string  `json:"country" xml:"country"`
	Latitude  float64 `json:"latitude" xml:"latitude"`
	Longitude float64 `json:"longitude" xml:"longitude"`
}

AddressInfo is a struct full of address information

func Address

func Address() *AddressInfo

Address will generate a struct of address information

Example
Seed(11)
address := Address()
fmt.Println(address.Address)
fmt.Println(address.Street)
fmt.Println(address.City)
fmt.Println(address.State)
fmt.Println(address.Zip)
fmt.Println(address.Country)
fmt.Println(address.Latitude)
fmt.Println(address.Longitude)
Output:

364 Unionsville, Norfolk, Ohio 99536
364 Unionsville
Norfolk
Ohio
99536
Lesotho
88.792592
174.504681

type BookInfo added in v6.22.0

type BookInfo struct {
	Title  string `json:"title" xml:"name"`
	Author string `json:"author" xml:"author"`
	Genre  string `json:"genre" xml:"genre"`
}

func Book added in v6.22.0

func Book() *BookInfo
Example
Seed(11)
book := Book()
fmt.Println(book.Title)
fmt.Println(book.Author)
fmt.Println(book.Genre)
Output:

Anna Karenina
Toni Morrison
Thriller

type CSVOptions

type CSVOptions struct {
	Delimiter string  `json:"delimiter" xml:"delimiter" fake:"{randomstring:[,,tab]}"`
	RowCount  int     `json:"row_count" xml:"row_count" fake:"{number:1,10}"`
	Fields    []Field `json:"fields" xml:"fields" fake:"{fields}"`
}

CSVOptions defines values needed for csv generation

type CarInfo

type CarInfo struct {
	Type         string `json:"type" xml:"type"`
	Fuel         string `json:"fuel" xml:"fuel"`
	Transmission string `json:"transmission" xml:"transmission"`
	Brand        string `json:"brand" xml:"brand"`
	Model        string `json:"model" xml:"model"`
	Year         int    `json:"year" xml:"year"`
}

CarInfo is a struct dataset of all car information

func Car

func Car() *CarInfo

Car will generate a struct with car information

Example
Seed(11)
car := Car()
fmt.Println(car.Brand)
fmt.Println(car.Fuel)
fmt.Println(car.Model)
fmt.Println(car.Transmission)
fmt.Println(car.Type)
fmt.Println(car.Year)
Output:

Fiat
Gasoline
Freestyle Fwd
Automatic
Passenger car mini
1965

type ContactInfo

type ContactInfo struct {
	Phone string `json:"phone" xml:"phone"`
	Email string `json:"email" xml:"email"`
}

ContactInfo struct full of contact info

func Contact

func Contact() *ContactInfo

Contact will generate a struct with information randomly populated contact information

Example
Seed(11)
contact := Contact()
fmt.Println(contact.Phone)
fmt.Println(contact.Email)
Output:

6136459948
carolecarroll@bosco.com

type CreditCardInfo

type CreditCardInfo struct {
	Type   string `json:"type" xml:"type"`
	Number string `json:"number" xml:"number"`
	Exp    string `json:"exp" xml:"exp"`
	Cvv    string `json:"cvv" xml:"cvv"`
}

CreditCardInfo is a struct containing credit variables

func CreditCard

func CreditCard() *CreditCardInfo

CreditCard will generate a struct full of credit card information

Example
Seed(11)
ccInfo := CreditCard()
fmt.Println(ccInfo.Type)
fmt.Println(ccInfo.Number)
fmt.Println(ccInfo.Exp)
fmt.Println(ccInfo.Cvv)
Output:

UnionPay
4364599489953698
02/25
300

type CreditCardOptions

type CreditCardOptions struct {
	Types []string `json:"types"`
	Bins  []string `json:"bins"` // optional parameter of prepended numbers
	Gaps  bool     `json:"gaps"`
}

CreditCardOptions is the options for credit card number

type CurrencyInfo

type CurrencyInfo struct {
	Short string `json:"short" xml:"short"`
	Long  string `json:"long" xml:"long"`
}

CurrencyInfo is a struct of currency information

func Currency

func Currency() *CurrencyInfo

Currency will generate a struct with random currency information

Example
Seed(11)
currency := Currency()
fmt.Println(currency.Short)
fmt.Println(currency.Long)
Output:

IQD
Iraq Dinar

type EmailOptions added in v6.25.0

type EmailOptions struct {
}

EmailOptions defines values needed for email document generation

type Fakeable added in v6.21.0

type Fakeable interface {
	// Fake returns a fake value for the type.
	Fake(faker *Faker) (any, error)
}

Fakeable is an interface that can be implemented by a type to provide a custom fake value.

Example
var t1 testStruct1
var t2 testStruct1
var t3 testStruct2
var t4 testStruct2
New(314).Struct(&t1)
New(314).Struct(&t2)
New(314).Struct(&t3)
New(314).Struct(&t4)

fmt.Printf("%#v\n", t1)
fmt.Printf("%#v\n", t2)
fmt.Printf("%#v\n", t3)
fmt.Printf("%#v\n", t4)
// Expected Output:
// gofakeit.testStruct1{B:"Margarette"}
// gofakeit.testStruct1{B:"Margarette"}
// gofakeit.testStruct2{B:"Margarette"}
// gofakeit.testStruct2{B:"Margarette"}
Output:

type Faker

type Faker struct {
	Rand *rand.Rand
}

Faker struct is the primary struct for using localized.

func New

func New(seed int64) *Faker

New will utilize math/rand for concurrent random usage. Setting seed to 0 will use crypto/rand for the initial seed number.

Example
// Create new pseudo random faker struct and set initial seed
fake := New(11)

// All global functions are also available in the structs methods
fmt.Println("Name:", fake.Name())
fmt.Println("Email:", fake.Email())
fmt.Println("Phone:", fake.Phone())
Output:

Name: Markus Moen
Email: alaynawuckert@kozey.biz
Phone: 9948995369

func NewCrypto

func NewCrypto() *Faker

NewCrypto will utilize crypto/rand for concurrent random usage.

Example
// Create new crypto faker struct
fake := NewCrypto()

// All global functions are also available in the structs methods
fmt.Println("Name:", fake.Name())
fmt.Println("Email:", fake.Email())
fmt.Println("Phone:", fake.Phone())

// Cannot output example as crypto/rand cant be predicted
Output:

func NewCustom

func NewCustom(source rand.Source64) *Faker

NewCustom will utilize a custom rand.Source64 for concurrent random usage See https://golang.org/src/math/rand/rand.go for required interface methods

Example
// Setup stuct and methods required to meet interface needs
// type customRand struct {}
// func (c *customRand) Seed(seed int64) {}
// func (c *customRand) Uint64() uint64 { return 8675309 }
// func (c *customRand) Int63() int64 { return int64(c.Uint64() & ^uint64(1<<63)) }

// Create new custom faker struct
fake := NewCustom(&customRand{})

// All global functions are also available in the structs methods
fmt.Println("Name:", fake.Name())
fmt.Println("Email:", fake.Email())
fmt.Println("Phone:", fake.Phone())
Output:

Name: Aaliyah Abbott
Email: aaliyahabbott@abbott.com
Phone: 1000000000

func NewUnlocked added in v6.9.0

func NewUnlocked(seed int64) *Faker

NewUnlocked will utilize math/rand for non concurrent safe random usage. Setting seed to 0 will use crypto/rand for the initial seed number. NewUnlocked is more performant but not safe to run concurrently.

Example
fake := NewUnlocked(11)

// All global functions are also available in the structs methods
fmt.Println("Name:", fake.Name())
fmt.Println("Email:", fake.Email())
fmt.Println("Phone:", fake.Phone())
Output:

Name: Markus Moen
Email: alaynawuckert@kozey.biz
Phone: 9948995369

func (*Faker) AchAccount

func (f *Faker) AchAccount() string

AchAccount will generate a 12 digit account number

Example
f := New(11)
fmt.Println(f.AchAccount())
Output:

413645994899

func (*Faker) AchRouting

func (f *Faker) AchRouting() string

AchRouting will generate a 9 digit routing number

Example
f := New(11)
fmt.Println(f.AchRouting())
Output:

713645994

func (*Faker) Address

func (f *Faker) Address() *AddressInfo

Address will generate a struct of address information

Example
f := New(11)
address := f.Address()
fmt.Println(address.Address)
fmt.Println(address.Street)
fmt.Println(address.City)
fmt.Println(address.State)
fmt.Println(address.Zip)
fmt.Println(address.Country)
fmt.Println(address.Latitude)
fmt.Println(address.Longitude)
Output:

364 Unionsville, Norfolk, Ohio 99536
364 Unionsville
Norfolk
Ohio
99536
Lesotho
88.792592
174.504681

func (*Faker) Adjective

func (f *Faker) Adjective() string

Adjective will generate a random adjective

Example
f := New(11)
fmt.Println(f.Adjective())
Output:

Dutch

func (*Faker) AdjectiveDemonstrative added in v6.11.0

func (f *Faker) AdjectiveDemonstrative() string

AdjectiveDemonstrative will generate a random demonstrative adjective

Example
f := New(11)
fmt.Println(f.AdjectiveDemonstrative())
Output:

this

func (*Faker) AdjectiveDescriptive added in v6.11.0

func (f *Faker) AdjectiveDescriptive() string

AdjectiveDescriptive will generate a random descriptive adjective

Example
f := New(11)
fmt.Println(f.AdjectiveDescriptive())
Output:

brave

func (*Faker) AdjectiveIndefinite added in v6.11.0

func (f *Faker) AdjectiveIndefinite() string

AdjectiveIndefinite will generate a random indefinite adjective

Example
f := New(11)
fmt.Println(f.AdjectiveIndefinite())
Output:

few

func (*Faker) AdjectiveInterrogative added in v6.11.0

func (f *Faker) AdjectiveInterrogative() string

AdjectiveInterrogative will generate a random interrogative adjective

Example
f := New(11)
fmt.Println(f.AdjectiveInterrogative())
Output:

what

func (*Faker) AdjectivePossessive added in v6.11.0

func (f *Faker) AdjectivePossessive() string

AdjectivePossessive will generate a random possessive adjective

Example
f := New(11)
fmt.Println(f.AdjectivePossessive())
Output:

our

func (*Faker) AdjectiveProper added in v6.11.0

func (f *Faker) AdjectiveProper() string

AdjectiveProper will generate a random proper adjective

Example
f := New(11)
fmt.Println(f.AdjectiveProper())
Output:

Afghan

func (*Faker) AdjectiveQuantitative added in v6.11.0

func (f *Faker) AdjectiveQuantitative() string

AdjectiveQuantitative will generate a random quantitative adjective

Example
f := New(11)
fmt.Println(f.AdjectiveQuantitative())
Output:

a little

func (*Faker) Adverb

func (f *Faker) Adverb() string

Adverb will generate a random adverb

Example
f := New(11)
fmt.Println(f.Adverb())
Output:

over

func (*Faker) AdverbDegree added in v6.11.0

func (f *Faker) AdverbDegree() string

AdverbDegree will generate a random degree adverb

Example
f := New(11)
fmt.Println(f.AdverbDegree())
Output:

intensely

func (*Faker) AdverbFrequencyDefinite added in v6.11.0

func (f *Faker) AdverbFrequencyDefinite() string

AdverbFrequencyDefinite will generate a random frequency definite adverb

Example
f := New(11)
fmt.Println(f.AdverbFrequencyDefinite())
Output:

hourly

func (*Faker) AdverbFrequencyIndefinite added in v6.11.0

func (f *Faker) AdverbFrequencyIndefinite() string

AdverbFrequencyIndefinite will generate a random frequency indefinite adverb

Example
f := New(11)
fmt.Println(f.AdverbFrequencyIndefinite())
Output:

occasionally

func (*Faker) AdverbManner added in v6.11.0

func (f *Faker) AdverbManner() string

AdverbManner will generate a random manner adverb

Example
f := New(11)
fmt.Println(f.AdverbManner())
Output:

stupidly

func (*Faker) AdverbPlace added in v6.11.0

func (f *Faker) AdverbPlace() string

AdverbPlace will generate a random place adverb

Example
f := New(11)
fmt.Println(f.AdverbPlace())
Output:

east

func (*Faker) AdverbTimeDefinite added in v6.11.0

func (f *Faker) AdverbTimeDefinite() string

AdverbTimeDefinite will generate a random time definite adverb

Example
f := New(11)
fmt.Println(f.AdverbTimeDefinite())
Output:

now

func (*Faker) AdverbTimeIndefinite added in v6.11.0

func (f *Faker) AdverbTimeIndefinite() string

AdverbTimeIndefinite will generate a random time indefinite adverb

Example
f := New(11)
fmt.Println(f.AdverbTimeIndefinite())
Output:

already

func (*Faker) Animal

func (f *Faker) Animal() string

Animal will return a random animal

Example
f := New(11)
fmt.Println(f.Animal())
Output:

elk

func (*Faker) AnimalType

func (f *Faker) AnimalType() string

AnimalType will return a random animal type

Example
f := New(11)
fmt.Println(f.AnimalType())
Output:

amphibians

func (*Faker) AppAuthor

func (f *Faker) AppAuthor() string

AppAuthor will generate a random company or person name

Example
f := New(11)
fmt.Println(f.AppAuthor())
Output:

Marcel Pagac

func (*Faker) AppName

func (f *Faker) AppName() string

AppName will generate a random app name

Example
f := New(11)
fmt.Println(f.AppName())
Output:

Oxbeing

func (*Faker) AppVersion

func (f *Faker) AppVersion() string

AppVersion will generate a random app version

Example
f := New(11)
fmt.Println(f.AppVersion())
Output:

1.17.20

func (*Faker) BS

func (f *Faker) BS() string

BS will generate a random company bs string

Example
f := New(11)
fmt.Println(f.BS())
Output:

front-end

func (*Faker) BeerAlcohol

func (f *Faker) BeerAlcohol() string

BeerAlcohol will return a random beer alcohol level between 2.0 and 10.0

Example
f := New(11)
fmt.Println(f.BeerAlcohol())
Output:

2.7%

func (*Faker) BeerBlg

func (f *Faker) BeerBlg() string

BeerBlg will return a random beer blg between 5.0 and 20.0

Example
f := New(11)
fmt.Println(f.BeerBlg())
Output:

6.4°Blg

func (*Faker) BeerHop

func (f *Faker) BeerHop() string

BeerHop will return a random beer hop

Example
f := New(11)
fmt.Println(f.BeerHop())
Output:

Glacier

func (*Faker) BeerIbu

func (f *Faker) BeerIbu() string

BeerIbu will return a random beer ibu value between 10 and 100

Example
f := New(11)
fmt.Println(f.BeerIbu())
Output:

47 IBU

func (*Faker) BeerMalt

func (f *Faker) BeerMalt() string

BeerMalt will return a random beer malt

Example
f := New(11)
fmt.Println(f.BeerMalt())
Output:

Munich

func (*Faker) BeerName

func (f *Faker) BeerName() string

BeerName will return a random beer name

Example
f := New(11)
fmt.Println(f.BeerName())
Output:

Duvel

func (*Faker) BeerStyle

func (f *Faker) BeerStyle() string

BeerStyle will return a random beer style

Example
f := New(11)
fmt.Println(f.BeerStyle())
Output:

European Amber Lager

func (*Faker) BeerYeast

func (f *Faker) BeerYeast() string

BeerYeast will return a random beer yeast

Example
f := New(11)
fmt.Println(f.BeerYeast())
Output:

1388 - Belgian Strong Ale

func (*Faker) Bird added in v6.20.0

func (f *Faker) Bird() string

Bird will return a random bird species

Example
f := New(11)
fmt.Println(f.Bird())
Output:

goose

func (*Faker) BitcoinAddress

func (f *Faker) BitcoinAddress() string

BitcoinAddress will generate a random bitcoin address consisting of numbers, upper and lower characters

Example
f := New(11)
fmt.Println(f.BitcoinAddress())
Output:

1zXE46Al58w4vS0459PHl6YwElXZH09e

func (*Faker) BitcoinPrivateKey

func (f *Faker) BitcoinPrivateKey() string

BitcoinPrivateKey will generate a random bitcoin private key base58 consisting of numbers, upper and lower characters

Example
f := New(11)
fmt.Println(f.BitcoinPrivateKey())
Output:

5KWjEJ7SnBNJyDjdPUjLuYByYzM9rG1trax8c2NTSBtv7YtR57v

func (*Faker) Blurb added in v6.22.0

func (f *Faker) Blurb() string
Example
f := New(11)
fmt.Println(f.Blurb())
Output:

Motivation

func (*Faker) Book added in v6.22.0

func (f *Faker) Book() *BookInfo
Example
f := New(11)
book := f.Book()
fmt.Println(book.Title)
fmt.Println(book.Author)
fmt.Println(book.Genre)
Output:

Anna Karenina
Toni Morrison
Thriller

func (*Faker) BookAuthor added in v6.22.0

func (f *Faker) BookAuthor() string
Example
f := New(11)
fmt.Println(f.BookAuthor())
Output:

James Joyce

func (*Faker) BookGenre added in v6.22.0

func (f *Faker) BookGenre() string
Example
f := New(11)
fmt.Println(f.BookGenre())
Output:

Crime

func (*Faker) BookTitle added in v6.22.0

func (f *Faker) BookTitle() string
Example
f := New(11)
fmt.Println(f.BookTitle())
Output:

Anna Karenina

func (*Faker) Bool

func (f *Faker) Bool() bool

Bool will generate a random boolean value

Example
f := New(11)
fmt.Println(f.Bool())
Output:

true

func (*Faker) Breakfast

func (f *Faker) Breakfast() string

Breakfast will return a random breakfast name

Example
f := New(11)
fmt.Println(f.Breakfast())
Output:

Blueberry banana happy face pancakes

func (*Faker) BuzzWord

func (f *Faker) BuzzWord() string

BuzzWord will generate a random company buzz word string

Example
f := New(11)
fmt.Println(f.BuzzWord())
Output:

disintermediate

func (*Faker) CSV

func (f *Faker) CSV(co *CSVOptions) ([]byte, error)

CSV generates an object or an array of objects in json format A nil CSVOptions returns a randomly structured CSV.

Example (Array)
f := New(11)

value, err := f.CSV(&CSVOptions{
	RowCount: 3,
	Fields: []Field{
		{Name: "id", Function: "autoincrement"},
		{Name: "first_name", Function: "firstname"},
		{Name: "last_name", Function: "lastname"},
		{Name: "password", Function: "password", Params: MapParams{"special": {"false"}}},
	},
})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

id,first_name,last_name,password
1,Markus,Moen,856Y5wPZevX9
2,Jalon,Rolfson,64wz4EAS0Hl0
3,Nestor,Harris,14GKq1j7Lx4T

func (*Faker) Car

func (f *Faker) Car() *CarInfo

Car will generate a struct with car information

Example
f := New(11)
car := f.Car()
fmt.Println(car.Brand)
fmt.Println(car.Fuel)
fmt.Println(car.Model)
fmt.Println(car.Transmission)
fmt.Println(car.Type)
fmt.Println(car.Year)
Output:

Fiat
Gasoline
Freestyle Fwd
Automatic
Passenger car mini
1965

func (*Faker) CarFuelType

func (f *Faker) CarFuelType() string

CarFuelType will return a random fuel type

Example
f := New(11)
fmt.Println(f.CarFuelType())
Output:

CNG

func (*Faker) CarMaker

func (f *Faker) CarMaker() string

CarMaker will return a random car maker

Example
f := New(11)
fmt.Println(f.CarMaker())
Output:

Nissan

func (*Faker) CarModel

func (f *Faker) CarModel() string

CarModel will return a random car model

Example
f := New(11)
fmt.Println(f.CarModel())
Output:

Aveo

func (*Faker) CarTransmissionType

func (f *Faker) CarTransmissionType() string

CarTransmissionType will return a random transmission type

Example
f := New(11)
fmt.Println(f.CarTransmissionType())
Output:

Manual

func (*Faker) CarType

func (f *Faker) CarType() string

CarType will generate a random car type string

Example
f := New(11)
fmt.Println(f.CarType())
Output:

Passenger car mini

func (*Faker) Cat

func (f *Faker) Cat() string

Cat will return a random cat breed

Example
f := New(11)
fmt.Println(f.Cat())
Output:

Sokoke

func (*Faker) CelebrityActor added in v6.11.0

func (f *Faker) CelebrityActor() string

CelebrityActor will generate a random celebrity actor

Example
f := New(11)
fmt.Println(f.CelebrityActor())
Output:

Owen Wilson

func (*Faker) CelebrityBusiness added in v6.11.0

func (f *Faker) CelebrityBusiness() string

CelebrityBusiness will generate a random celebrity business person

Example
f := New(11)
fmt.Println(f.CelebrityBusiness())
Output:

Cameron Diaz

func (*Faker) CelebritySport added in v6.11.0

func (f *Faker) CelebritySport() string

CelebritySport will generate a random celebrity sport person

Example
f := New(11)
fmt.Println(f.CelebritySport())
Output:

Hicham El Guerrouj

func (*Faker) ChromeUserAgent

func (f *Faker) ChromeUserAgent() string

ChromeUserAgent will generate a random chrome browser user agent string

Example
f := New(11)
fmt.Println(f.ChromeUserAgent())
Output:

Mozilla/5.0 (X11; Linux i686) AppleWebKit/5360 (KHTML, like Gecko) Chrome/40.0.889.0 Mobile Safari/5360

func (*Faker) City

func (f *Faker) City() string

City will generate a random city string

Example
f := New(11)
fmt.Println(f.City())
Output:

Plano

func (*Faker) Color

func (f *Faker) Color() string

Color will generate a random color string

Example
f := New(11)
fmt.Println(f.Color())
Output:

MediumOrchid

func (*Faker) Comment added in v6.28.0

func (f *Faker) Comment() string

Comment will generate a random statement or remark expressing an opinion, observation, or reaction

Example
f := New(11)
fmt.Println(f.Comment())
Output:

Phew Substantial Thing Had Regularly.

func (*Faker) Company

func (f *Faker) Company() string

Company will generate a random company name string

Example
f := New(11)
fmt.Println(f.Company())
Output:

ClearHealthCosts

func (*Faker) CompanySuffix

func (f *Faker) CompanySuffix() string

CompanySuffix will generate a random company suffix string

Example
f := New(11)
fmt.Println(f.CompanySuffix())
Output:

Inc

func (*Faker) Connective added in v6.11.0

func (f *Faker) Connective() string

Connective will generate a random connective

Example
f := New(11)
fmt.Println(f.Connective())
Output:

such as

func (*Faker) ConnectiveCasual added in v6.11.0

func (f *Faker) ConnectiveCasual() string

ConnectiveCasual will generate a random casual connective

Example
f := New(11)
fmt.Println(f.ConnectiveCasual())
Output:

an outcome of

func (*Faker) ConnectiveComparative added in v6.23.0

func (f *Faker) ConnectiveComparative() string

ConnectiveComparative will generate a random comparative connective

Example
f := New(11)
fmt.Println(f.ConnectiveComparative())
Output:

in addition

func (*Faker) ConnectiveComplaint added in v6.11.0

func (f *Faker) ConnectiveComplaint() string

ConnectiveComplaint will generate a random complaint connective

Example
f := New(11)
fmt.Println(f.ConnectiveComplaint())
Output:

besides

func (*Faker) ConnectiveExamplify added in v6.11.0

func (f *Faker) ConnectiveExamplify() string

ConnectiveExamplify will generate a random examplify connective

Example
f := New(11)
fmt.Println(f.ConnectiveExamplify())
Output:

then

func (*Faker) ConnectiveListing added in v6.11.0

func (f *Faker) ConnectiveListing() string

ConnectiveListing will generate a random listing connective

Example
f := New(11)
fmt.Println(f.ConnectiveListing())
Output:

firstly

func (*Faker) ConnectiveTime added in v6.11.0

func (f *Faker) ConnectiveTime() string
Example
f := New(11)
fmt.Println(f.ConnectiveTime())
Output:

finally

func (*Faker) Contact

func (f *Faker) Contact() *ContactInfo

Contact will generate a struct with information randomly populated contact information

Example
f := New(11)
contact := f.Contact()
fmt.Println(contact.Phone)
fmt.Println(contact.Email)
Output:

6136459948
carolecarroll@bosco.com

func (*Faker) Country

func (f *Faker) Country() string

Country will generate a random country string

Example
f := New(11)
fmt.Println(f.Country())
Output:

Cabo Verde

func (*Faker) CountryAbr

func (f *Faker) CountryAbr() string

CountryAbr will generate a random abbreviated country string

Example
f := New(11)
fmt.Println(f.CountryAbr())
Output:

CV

func (*Faker) CreditCard

func (f *Faker) CreditCard() *CreditCardInfo

CreditCard will generate a struct full of credit card information

Example
f := New(11)
ccInfo := f.CreditCard()
fmt.Println(ccInfo.Type)
fmt.Println(ccInfo.Number)
fmt.Println(ccInfo.Exp)
fmt.Println(ccInfo.Cvv)
Output:

UnionPay
4364599489953698
02/25
300

func (*Faker) CreditCardCvv

func (f *Faker) CreditCardCvv() string

CreditCardCvv will generate a random CVV number Its a string because you could have 017 as an exp date

Example
f := New(11)
fmt.Println(f.CreditCardCvv())
Output:

513

func (*Faker) CreditCardExp

func (f *Faker) CreditCardExp() string

CreditCardExp will generate a random credit card expiration date string Exp date will always be a future date

Example
f := New(11)
fmt.Println(f.CreditCardExp())
Output:

06/31

func (*Faker) CreditCardNumber

func (f *Faker) CreditCardNumber(cco *CreditCardOptions) string

CreditCardNumber will generate a random luhn credit card number

Example
f := New(11)
fmt.Println(f.CreditCardNumber(nil))
fmt.Println(f.CreditCardNumber(&CreditCardOptions{Types: []string{"visa", "discover"}}))
fmt.Println(f.CreditCardNumber(&CreditCardOptions{Bins: []string{"4111"}}))
fmt.Println(f.CreditCardNumber(&CreditCardOptions{Gaps: true}))
Output:

4136459948995375
4635300425914586
4111232020276132
3054 800889 9827

func (*Faker) CreditCardType

func (f *Faker) CreditCardType() string

CreditCardType will generate a random credit card type string

Example
f := New(11)
fmt.Println(f.CreditCardType())
Output:

Visa

func (*Faker) Currency

func (f *Faker) Currency() *CurrencyInfo

Currency will generate a struct with random currency information

Example
f := New(11)
currency := f.Currency()
fmt.Println(currency.Short)
fmt.Println(currency.Long)
Output:

IQD
Iraq Dinar

func (*Faker) CurrencyLong

func (f *Faker) CurrencyLong() string

CurrencyLong will generate a random long currency name

Example
f := New(11)
fmt.Println(f.CurrencyLong())
Output:

Iraq Dinar

func (*Faker) CurrencyShort

func (f *Faker) CurrencyShort() string

CurrencyShort will generate a random short currency value

Example
f := New(11)
fmt.Println(f.CurrencyShort())
Output:

IQD

func (*Faker) Cusip added in v6.21.0

func (f *Faker) Cusip() string
Example
f := New(11)
fmt.Println(f.Cusip())
Output:

MLRQCZBX0

func (*Faker) Date

func (f *Faker) Date() time.Time

Date will generate a random time.Time struct

Example
f := New(11)
fmt.Println(f.Date())
Output:

1915-01-24 13:00:35.820738079 +0000 UTC

func (*Faker) DateRange

func (f *Faker) DateRange(start, end time.Time) time.Time

DateRange will generate a random time.Time struct between a start and end date

Example
f := New(11)
fmt.Println(f.DateRange(time.Unix(0, 484633944473634951), time.Unix(0, 1431318744473668209))) // May 10, 1985 years to May 10, 2015
Output:

2012-02-04 14:10:37.166933216 +0000 UTC

func (*Faker) Day

func (f *Faker) Day() int

Day will generate a random day between 1 - 31

Example
f := New(11)
fmt.Println(f.Day())
Output:

23

func (*Faker) Dessert

func (f *Faker) Dessert() string

Dessert will return a random dessert name

Example
f := New(11)
fmt.Println(f.Dessert())
Output:

French napoleons

func (*Faker) Dice added in v6.14.0

func (f *Faker) Dice(numDice uint, sides []uint) []uint

Dice will generate a random set of dice

Example
f := New(11)
fmt.Println(f.Dice(1, []uint{6}))
Output:

[6]

func (*Faker) Digit

func (f *Faker) Digit() string

Digit will generate a single ASCII digit

Example
f := New(11)
fmt.Println(f.Digit())
Output:

0

func (*Faker) DigitN

func (f *Faker) DigitN(n uint) string

DigitN will generate a random string of length N consists of ASCII digits. Note that the string generated can start with 0 and this function returns a string with a length of 1 when 0 is passed.

Example
f := New(11)
fmt.Println(f.DigitN(10))
Output:

0136459948

func (*Faker) Dinner

func (f *Faker) Dinner() string

Dinner will return a random dinner name

Example
f := New(11)
fmt.Println(f.Dinner())
Output:

Wild addicting dip

func (*Faker) Dog

func (f *Faker) Dog() string

Dog will return a random dog breed

Example
f := New(11)
fmt.Println(f.Dog())
Output:

Norwich Terrier

func (*Faker) DomainName

func (f *Faker) DomainName() string

DomainName will generate a random url domain name

Example
f := New(11)
fmt.Println(f.DomainName())
Output:

centraltarget.biz

func (*Faker) DomainSuffix

func (f *Faker) DomainSuffix() string

DomainSuffix will generate a random domain suffix

Example
f := New(11)
fmt.Println(f.DomainSuffix())
Output:

org

func (*Faker) Drink added in v6.19.0

func (f *Faker) Drink() string

Drink will return a random drink name

Example
f := New(11)
fmt.Println(f.Drink())
Output:

Juice

func (*Faker) Email

func (f *Faker) Email() string

Email will generate a random email string

Example
f := New(11)
fmt.Println(f.Email())
Output:

markusmoen@pagac.net

func (*Faker) EmailText added in v6.25.0

func (f *Faker) EmailText(co *EmailOptions) (string, error)

EmailText will return a single random text email template document

Example
f := New(11)

value, err := f.EmailText(&EmailOptions{})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

	Subject: Greetings from Marcel!

Dear Pagac,

Hello there! Sending positive vibes your way.

I hope you're doing great. May your week be filled with joy.

This me far smile where was by army party riches. Theirs instead here mine whichever that those instance growth has. Ouch enough Swiss us since down he she aha us. You to upon how this this furniture way no play. Towel that us to accordingly theirs purse enough so though.

Election often until eek weekly yet oops until conclude his. Stay elsewhere such that galaxy clean that last each stack. Reluctantly theirs wisp aid firstly highly butter accordingly should already. Calm shake according fade neither kuban upon this he fortnightly. Occasionally bunch on who elsewhere lastly hourly right there honesty.

We is how result out Shakespearean have whom yearly another. Packet are behind late lot finally time themselves goodness quizzical. Our therefore could fact cackle yourselves zebra for whose enormously. All bowl out wandering secondly yellow another your hourly spit. Since tomorrow hers words little think will our by Polynesian.

I'm curious to know what you think about it. If you have a moment, please feel free to check out the project on GitLab

Your insights would be invaluable. Your thoughts matter to me.

I appreciate your attention to this matter. Your feedback is greatly appreciated.

Best wishes
Daryl Leannon
oceaneokuneva@roberts.org
1-816-608-2233

func (*Faker) Emoji

func (f *Faker) Emoji() string

Emoji will return a random fun emoji

Example
f := New(11)
fmt.Println(f.Emoji())
Output:

🧛

func (*Faker) EmojiAlias

func (f *Faker) EmojiAlias() string

EmojiAlias will return a random fun emoji alias

Example
f := New(11)
fmt.Println(f.EmojiAlias())
Output:

deaf_person

func (*Faker) EmojiCategory

func (f *Faker) EmojiCategory() string

EmojiCategory will return a random fun emoji category

Example
f := New(11)
fmt.Println(f.EmojiCategory())
Output:

Food & Drink

func (*Faker) EmojiDescription

func (f *Faker) EmojiDescription() string

EmojiDescription will return a random fun emoji description

Example
f := New(11)
fmt.Println(f.EmojiDescription())
Output:

confetti ball

func (*Faker) EmojiTag

func (f *Faker) EmojiTag() string

EmojiTag will return a random fun emoji tag

Example
f := New(11)
fmt.Println(f.EmojiTag())
Output:

strong

func (*Faker) Error added in v6.20.0

func (f *Faker) Error() error

Error will return a random generic error

Example
f := New(11)
fmt.Println(f.Error())
Output:

failed to calculate pointer

func (*Faker) ErrorDatabase added in v6.20.0

func (f *Faker) ErrorDatabase() error

ErrorDatabase will return a random database error

Example
f := New(11)
fmt.Println(f.ErrorDatabase())
Output:

bad connection

func (*Faker) ErrorGRPC added in v6.20.0

func (f *Faker) ErrorGRPC() error

ErrorGRPC will return a random gRPC error

Example
f := New(11)
fmt.Println(f.ErrorGRPC())
Output:

connection refused

func (*Faker) ErrorHTTP added in v6.20.0

func (f *Faker) ErrorHTTP() error

ErrorHTTP will return a random HTTP error

Example
f := New(11)
fmt.Println(f.ErrorHTTP())
Output:

wrote more than the declared Content-Length

func (*Faker) ErrorHTTPClient added in v6.20.0

func (f *Faker) ErrorHTTPClient() error

ErrorHTTPClient will return a random HTTP client error response (400-418)

Example
f := New(11)
fmt.Println(f.ErrorHTTPClient())
Output:

payment required

func (*Faker) ErrorHTTPServer added in v6.20.0

func (f *Faker) ErrorHTTPServer() error

ErrorHTTPServer will return a random HTTP server error response (500-511)

Example
f := New(11)
fmt.Println(f.ErrorHTTPServer())
Output:

internal server error

func (*Faker) ErrorObject added in v6.20.0

func (f *Faker) ErrorObject() error

ErrorObject will return a random error object word

Example
f := New(11)
fmt.Println(f.ErrorObject())
Output:

argument

func (*Faker) ErrorRuntime added in v6.20.0

func (f *Faker) ErrorRuntime() error

ErrorRuntime will return a random runtime error

Example
f := New(11)
fmt.Println(f.ErrorRuntime())
Output:

panic: runtime error: invalid memory address or nil pointer dereference

func (*Faker) ErrorValidation added in v6.20.0

func (f *Faker) ErrorValidation() error

ErrorValidation will return a random validation error

Example
f := New(11)
fmt.Println(f.ErrorValidation())
Output:

state max length exceeded

func (*Faker) FarmAnimal

func (f *Faker) FarmAnimal() string

FarmAnimal will return a random animal that usually lives on a farm

Example
f := New(11)
fmt.Println(f.FarmAnimal())
Output:

Chicken

func (*Faker) FileExtension

func (f *Faker) FileExtension() string

FileExtension will generate a random file extension

Example
f := New(11)
fmt.Println(f.FileExtension())
Output:

nes

func (*Faker) FileMimeType

func (f *Faker) FileMimeType() string

FileMimeType will generate a random mime file type

Example
f := New(11)
fmt.Println(f.FileMimeType())
Output:

application/dsptype

func (*Faker) FirefoxUserAgent

func (f *Faker) FirefoxUserAgent() string

FirefoxUserAgent will generate a random firefox broswer user agent string

Example
f := New(11)
fmt.Println(f.FirefoxUserAgent())
Output:

Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_9_10 rv:7.0) Gecko/1915-01-24 Firefox/36.0

func (*Faker) FirstName

func (f *Faker) FirstName() string

FirstName will generate a random first name

Example
f := New(11)
fmt.Println(f.FirstName())
Output:

Markus

func (*Faker) FixedWidth added in v6.25.0

func (f *Faker) FixedWidth(co *FixedWidthOptions) (string, error)

FixedWidth generates an table of random data in fixed width format A nil FixedWidthOptions returns a randomly structured FixedWidth.

Example
f := New(11)

value, err := f.FixedWidth(&FixedWidthOptions{
	RowCount: 3,
	Fields: []Field{
		{Name: "Name", Function: "{firstname} {lastname}"},
		{Name: "Email", Function: "email"},
		{Name: "Password", Function: "password", Params: MapParams{"special": {"false"}}},
		{Name: "Age", Function: "{number:1,100}"},
	},
})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

Name               Email                          Password         Age
Markus Moen        sylvanmraz@murphy.net          46HX9elvE5zl     43
Alayna Wuckert     santinostanton@carroll.biz     l6A0EVSC90w2     11
Lura Lockman       zacherykuhic@feil.name         xxL47424u8Ts     4

func (*Faker) FlipACoin

func (f *Faker) FlipACoin() string

FlipACoin will return a random value of Heads or Tails

Example
f := New(11)
fmt.Println(f.FlipACoin())
Output:

Heads

func (*Faker) Float32

func (f *Faker) Float32() float32

Float32 will generate a random float32 value

Example
f := New(11)
fmt.Println(f.Float32())
Output:

3.1128167e+37

func (*Faker) Float32Range

func (f *Faker) Float32Range(min, max float32) float32

Float32Range will generate a random float32 value between min and max

Example
f := New(11)
fmt.Println(f.Float32Range(0, 9999999))
Output:

914774.6

func (*Faker) Float64

func (f *Faker) Float64() float64

Float64 will generate a random float64 value

Example
f := New(11)
fmt.Println(f.Float64())
Output:

1.644484108270445e+307

func (*Faker) Float64Range

func (f *Faker) Float64Range(min, max float64) float64

Float64Range will generate a random float64 value between min and max

Example
f := New(11)
fmt.Println(f.Float64Range(0, 9999999))
Output:

914774.5585333086

func (*Faker) Fruit

func (f *Faker) Fruit() string

Fruit will return a random fruit name

Example
f := New(11)
fmt.Println(f.Fruit())
Output:

Peach

func (*Faker) FutureDate added in v6.23.0

func (f *Faker) FutureDate() time.Time

FutureDate will generate a random future time.Time struct

Example
f := New(11)
fmt.Println(f.FutureDate())
Output:

func (*Faker) Gamertag

func (f *Faker) Gamertag() string

Gamertag will generate a random video game username

Example
f := New(11)
fmt.Println(f.Gamertag())
Output:

PurpleSheep5

func (*Faker) Gender

func (f *Faker) Gender() string

Gender will generate a random gender string

Example
f := New(11)
fmt.Println(f.Gender())
Output:

male

func (*Faker) Generate

func (f *Faker) Generate(dataVal string) string

Generate fake information from given string. Replaceable values should be within {}

Functions Ex: {firstname} - billy Ex: {sentence:3} - Record river mind. Ex: {number:1,10} - 4 Ex: {uuid} - 590c1440-9888-45b0-bd51-a817ee07c3f2

Letters/Numbers Ex: ### - 481 - random numbers Ex: ??? - fda - random letters

For a complete list of runnable functions use FuncsLookup

Example
f := New(11)

fmt.Println(f.Generate("{firstname} {lastname} ssn is {ssn} and lives at {street}"))
fmt.Println(f.Generate("{sentence:3}"))
fmt.Println(f.Generate("{shuffleints:[1,2,3]}"))
fmt.Println(f.Generate("{randomint:[1,2,3,-4]}"))
fmt.Println(f.Generate("{randomuint:[1,2,3,4]}"))
fmt.Println(f.Generate("{number:1,50}"))
fmt.Println(f.Generate("{shufflestrings:[key:value,int:string,1:2,a:b]}"))
Output:

Markus Moen ssn is 526643139 and lives at 599 Daleton
Congolese choir computer.
[3 1 2]
2
4
17
[int:string 1:2 a:b key:value]

func (*Faker) HTTPMethod

func (f *Faker) HTTPMethod() string

HTTPMethod will generate a random http method

Example
f := New(11)
fmt.Println(f.HTTPMethod())
Output:

HEAD

func (*Faker) HTTPStatusCode

func (f *Faker) HTTPStatusCode() int

HTTPStatusCode will generate a random status code

Example
f := New(11)
fmt.Println(f.HTTPStatusCode())
Output:

404

func (*Faker) HTTPStatusCodeSimple

func (f *Faker) HTTPStatusCodeSimple() int

HTTPStatusCodeSimple will generate a random simple status code

Example
f := New(11)
fmt.Println(f.HTTPStatusCodeSimple())
Output:

200

func (*Faker) HTTPVersion added in v6.7.0

func (f *Faker) HTTPVersion() string

HTTPVersion will generate a random http version

Example
f := New(11)
fmt.Println(f.HTTPVersion())
Output:

HTTP/1.0

func (*Faker) HackerAbbreviation

func (f *Faker) HackerAbbreviation() string

HackerAbbreviation will return a random hacker abbreviation

Example
f := New(11)
fmt.Println(f.HackerAbbreviation())
Output:

ADP

func (*Faker) HackerAdjective

func (f *Faker) HackerAdjective() string

HackerAdjective will return a random hacker adjective

Example
f := New(11)
fmt.Println(f.HackerAdjective())
Output:

wireless

func (*Faker) HackerNoun

func (f *Faker) HackerNoun() string

HackerNoun will return a random hacker noun

Example
f := New(11)
fmt.Println(f.HackerNoun())
Output:

driver

func (*Faker) HackerPhrase

func (f *Faker) HackerPhrase() string

HackerPhrase will return a random hacker sentence

Example
f := New(11)
fmt.Println(f.HackerPhrase())
Output:

If we calculate the program, we can get to the AI pixel through the redundant XSS matrix!

func (*Faker) HackerVerb

func (f *Faker) HackerVerb() string

HackerVerb will return a random hacker verb

Example
f := New(11)
fmt.Println(f.HackerVerb())
Output:

synthesize

func (*Faker) HackeringVerb

func (f *Faker) HackeringVerb() string

HackeringVerb will return a random hacker ingverb

Example
f := New(11)
fmt.Println(f.HackeringVerb())
Output:

connecting

func (*Faker) HexColor

func (f *Faker) HexColor() string

HexColor will generate a random hexadecimal color string

Example
f := New(11)
fmt.Println(f.HexColor())
Output:

#a99fb4

func (*Faker) HexUint128 added in v6.7.1

func (f *Faker) HexUint128() string

HexUint128 will generate a random uint128 hex value with "0x" prefix

Example
f := New(11)
fmt.Println(f.HexUint128())
Output:

0x875469578e51b5e56c95b64681d147a1

func (*Faker) HexUint16 added in v6.7.1

func (f *Faker) HexUint16() string

HexUint16 will generate a random uint16 hex value with "0x" prefix

Example
f := New(11)
fmt.Println(f.HexUint16())
Output:

0x8754

func (*Faker) HexUint256 added in v6.7.1

func (f *Faker) HexUint256() string

HexUint256 will generate a random uint256 hex value with "0x" prefix

Example
f := New(11)
fmt.Println(f.HexUint256())
Output:

0x875469578e51b5e56c95b64681d147a12cde48a4f417231b0c486abbc263e48d

func (*Faker) HexUint32 added in v6.7.1

func (f *Faker) HexUint32() string

HexUint32 will generate a random uint32 hex value with "0x" prefix

Example
f := New(11)
fmt.Println(f.HexUint32())
Output:

0x87546957

func (*Faker) HexUint64 added in v6.7.1

func (f *Faker) HexUint64() string

HexUint64 will generate a random uint64 hex value with "0x" prefix

Example
f := New(11)
fmt.Println(f.HexUint64())
Output:

0x875469578e51b5e5

func (*Faker) HexUint8 added in v6.7.1

func (f *Faker) HexUint8() string

HexUint8 will generate a random uint8 hex value with "0x" prefix

Example
f := New(11)
fmt.Println(f.HexUint8())
Output:

0x87

func (*Faker) HipsterParagraph

func (f *Faker) HipsterParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string

HipsterParagraph will generate a random paragraphGenerator Set Paragraph Count Set Sentence Count Set Word Count Set Paragraph Separator

Example
f := New(11)
fmt.Println(f.HipsterParagraph(3, 5, 12, "\n"))
Output:

Microdosing roof chia echo pickled meditation cold-pressed raw denim fingerstache normcore sriracha pork belly. Wolf try-hard pop-up blog tilde hashtag health butcher waistcoat paleo portland vinegar. Microdosing sartorial blue bottle slow-carb freegan five dollar toast you probably haven't heard of them asymmetrical chia farm-to-table narwhal banjo. Gluten-free blog authentic literally synth vinyl meh ethical health fixie banh mi Yuccie. Try-hard drinking squid seitan cray VHS echo chillwave hammock kombucha food truck sustainable.
Pug bushwick hella tote bag cliche direct trade waistcoat yr waistcoat knausgaard pour-over master. Pitchfork jean shorts franzen flexitarian distillery hella meggings austin knausgaard crucifix wolf heirloom. Crucifix food truck you probably haven't heard of them trust fund fixie gentrify pitchfork stumptown mlkshk umami chambray blue bottle. 3 wolf moon swag +1 biodiesel knausgaard semiotics taxidermy meh artisan hoodie +1 blue bottle. Fashion axe forage mixtape Thundercats pork belly whatever 90's beard selfies chambray cred mlkshk.
Shabby chic typewriter VHS readymade lo-fi bitters PBR&B gentrify lomo raw denim freegan put a bird on it. Raw denim cliche dreamcatcher pug fixie park trust fund migas fingerstache sriracha +1 mustache. Tilde shoreditch kickstarter franzen dreamcatcher green juice mustache neutra polaroid stumptown organic schlitz. Flexitarian ramps chicharrones kogi lo-fi mustache tilde forage street church-key williamsburg taxidermy. Chia mustache plaid mumblecore squid slow-carb disrupt Thundercats goth shoreditch master direct trade.

func (*Faker) HipsterSentence

func (f *Faker) HipsterSentence(wordCount int) string

HipsterSentence will generate a random sentence

Example
f := New(11)
fmt.Println(f.HipsterSentence(5))
Output:

Microdosing roof chia echo pickled.

func (*Faker) HipsterWord

func (f *Faker) HipsterWord() string

HipsterWord will return a single hipster word

Example
f := New(11)
fmt.Println(f.HipsterWord())
Output:

microdosing

func (*Faker) Hobby added in v6.12.2

func (f *Faker) Hobby() string

Hobby will generate a random hobby string

Example
f := New(11)
fmt.Println(f.Hobby())
Output:

Transit map collecting

func (*Faker) Hour

func (f *Faker) Hour() int

Hour will generate a random hour - in military time

Example
f := New(11)
fmt.Println(f.Hour())
Output:

17

func (*Faker) IPv4Address

func (f *Faker) IPv4Address() string

IPv4Address will generate a random version 4 ip address

Example
f := New(11)
fmt.Println(f.IPv4Address())
Output:

152.23.53.100

func (*Faker) IPv6Address

func (f *Faker) IPv6Address() string

IPv6Address will generate a random version 6 ip address

Example
f := New(11)
fmt.Println(f.IPv6Address())
Output:

8898:ee17:bc35:9064:5866:d019:3b95:7857

func (*Faker) Image

func (f *Faker) Image(width int, height int) *img.RGBA

Image generates a random rgba image

Example
f := New(11)
fmt.Println(f.Image(1, 1))
Output:

&{[89 176 195 255] 4 (0,0)-(1,1)}

func (*Faker) ImageJpeg

func (f *Faker) ImageJpeg(width int, height int) []byte

ImageJpeg generates a random rgba jpeg image

Example
f := New(11)
fmt.Println(f.ImageJpeg(1, 1))
Output:

[255 216 255 219 0 132 0 8 6 6 7 6 5 8 7 7 7 9 9 8 10 12 20 13 12 11 11 12 25 18 19 15 20 29 26 31 30 29 26 28 28 32 36 46 39 32 34 44 35 28 28 40 55 41 44 48 49 52 52 52 31 39 57 61 56 50 60 46 51 52 50 1 9 9 9 12 11 12 24 13 13 24 50 33 28 33 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 255 192 0 17 8 0 1 0 1 3 1 34 0 2 17 1 3 17 1 255 196 1 162 0 0 1 5 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 16 0 2 1 3 3 2 4 3 5 5 4 4 0 0 1 125 1 2 3 0 4 17 5 18 33 49 65 6 19 81 97 7 34 113 20 50 129 145 161 8 35 66 177 193 21 82 209 240 36 51 98 114 130 9 10 22 23 24 25 26 37 38 39 40 41 42 52 53 54 55 56 57 58 67 68 69 70 71 72 73 74 83 84 85 86 87 88 89 90 99 100 101 102 103 104 105 106 115 116 117 118 119 120 121 122 131 132 133 134 135 136 137 138 146 147 148 149 150 151 152 153 154 162 163 164 165 166 167 168 169 170 178 179 180 181 182 183 184 185 186 194 195 196 197 198 199 200 201 202 210 211 212 213 214 215 216 217 218 225 226 227 228 229 230 231 232 233 234 241 242 243 244 245 246 247 248 249 250 1 0 3 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 17 0 2 1 2 4 4 3 4 7 5 4 4 0 1 2 119 0 1 2 3 17 4 5 33 49 6 18 65 81 7 97 113 19 34 50 129 8 20 66 145 161 177 193 9 35 51 82 240 21 98 114 209 10 22 36 52 225 37 241 23 24 25 26 38 39 40 41 42 53 54 55 56 57 58 67 68 69 70 71 72 73 74 83 84 85 86 87 88 89 90 99 100 101 102 103 104 105 106 115 116 117 118 119 120 121 122 130 131 132 133 134 135 136 137 138 146 147 148 149 150 151 152 153 154 162 163 164 165 166 167 168 169 170 178 179 180 181 182 183 184 185 186 194 195 196 197 198 199 200 201 202 210 211 212 213 214 215 216 217 218 226 227 228 229 230 231 232 233 234 242 243 244 245 246 247 248 249 250 255 218 0 12 3 1 0 2 17 3 17 0 63 0 216 162 138 43 213 62 92 255 217]

func (*Faker) ImagePng

func (f *Faker) ImagePng(width int, height int) []byte

ImagePng generates a random rgba png image

Example
f := New(11)
fmt.Println(f.ImagePng(1, 1))
Output:

[137 80 78 71 13 10 26 10 0 0 0 13 73 72 68 82 0 0 0 1 0 0 0 1 8 2 0 0 0 144 119 83 222 0 0 0 16 73 68 65 84 120 156 98 138 220 112 24 16 0 0 255 255 3 58 1 207 38 214 44 234 0 0 0 0 73 69 78 68 174 66 96 130]

func (*Faker) ImageURL

func (f *Faker) ImageURL(width int, height int) string

ImageURL will generate a random Image Based Upon Height And Width. https://picsum.photos/

Example
f := New(11)
fmt.Println(f.ImageURL(640, 480))
Output:

https://picsum.photos/640/480

func (*Faker) InputName added in v6.20.0

func (f *Faker) InputName() string

InputName will return a random input field name

Example
f := New(11)
fmt.Println(f.InputName())
Output:

message

func (*Faker) Int16

func (f *Faker) Int16() int16

Int16 will generate a random int16 value

Example
f := New(11)
fmt.Println(f.Int16())
Output:

-29607

func (*Faker) Int32

func (f *Faker) Int32() int32

Int32 will generate a random int32 value

Example
f := New(11)
fmt.Println(f.Int32())
Output:

-1072427943

func (*Faker) Int64

func (f *Faker) Int64() int64

Int64 will generate a random int64 value

Example
f := New(11)
fmt.Println(f.Int64())
Output:

-8379641344161477543

func (*Faker) Int8

func (f *Faker) Int8() int8

Int8 will generate a random Int8 value

Example
f := New(11)
fmt.Println(f.Int8())
Output:

-39

func (*Faker) IntRange added in v6.10.0

func (f *Faker) IntRange(min, max int) int

IntRange will generate a random int value between min and max

Example
f := New(11)
fmt.Println(f.IntRange(1, 10))
Output:

6

func (*Faker) Interjection added in v6.28.0

func (f *Faker) Interjection() string

Interjection will generate a random word expressing emotion

Example
f := New(11)
fmt.Println(f.Interjection())
Output:

wow

func (*Faker) Isin added in v6.21.0

func (f *Faker) Isin() string
Example
f := New(11)
fmt.Println(f.Isin())
Output:

AMMLRQCZBX03

func (*Faker) JSON

func (f *Faker) JSON(jo *JSONOptions) ([]byte, error)

JSON generates an object or an array of objects in json format. A nil JSONOptions returns a randomly structured JSON.

Example (Array)
f := New(11)

value, err := f.JSON(&JSONOptions{
	Type: "array",
	Fields: []Field{
		{Name: "id", Function: "autoincrement"},
		{Name: "first_name", Function: "firstname"},
		{Name: "last_name", Function: "lastname"},
		{Name: "password", Function: "password", Params: MapParams{"special": {"false"}}},
	},
	RowCount: 3,
	Indent:   true,
})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

[
    {
        "id": 1,
        "first_name": "Markus",
        "last_name": "Moen",
        "password": "856Y5wPZevX9"
    },
    {
        "id": 2,
        "first_name": "Jalon",
        "last_name": "Rolfson",
        "password": "64wz4EAS0Hl0"
    },
    {
        "id": 3,
        "first_name": "Nestor",
        "last_name": "Harris",
        "password": "14GKq1j7Lx4T"
    }
]
Example (Object)
f := New(11)

value, err := f.JSON(&JSONOptions{
	Type: "object",
	Fields: []Field{
		{Name: "first_name", Function: "firstname"},
		{Name: "last_name", Function: "lastname"},
		{Name: "address", Function: "address"},
		{Name: "password", Function: "password", Params: MapParams{"special": {"false"}}},
	},
	Indent: true,
})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

{
    "first_name": "Markus",
    "last_name": "Moen",
    "address": {
        "address": "4599 Daleton, Norfolk, New Jersey 36906",
        "street": "4599 Daleton",
        "city": "Norfolk",
        "state": "New Jersey",
        "zip": "36906",
        "country": "Tokelau",
        "latitude": 23.058758,
        "longitude": 89.022594
    },
    "password": "myZ1PgF9ThVL"
}

func (*Faker) Job

func (f *Faker) Job() *JobInfo

Job will generate a struct with random job information

Example
f := New(11)
jobInfo := f.Job()
fmt.Println(jobInfo.Company)
fmt.Println(jobInfo.Title)
fmt.Println(jobInfo.Descriptor)
fmt.Println(jobInfo.Level)
Output:

ClearHealthCosts
Agent
Future
Tactics

func (*Faker) JobDescriptor

func (f *Faker) JobDescriptor() string

JobDescriptor will generate a random job descriptor string

Example
f := New(11)
fmt.Println(f.JobDescriptor())
Output:

Central

func (*Faker) JobLevel

func (f *Faker) JobLevel() string

JobLevel will generate a random job level string

Example
f := New(11)
fmt.Println(f.JobLevel())
Output:

Assurance

func (*Faker) JobTitle

func (f *Faker) JobTitle() string

JobTitle will generate a random job title string

Example
f := New(11)
fmt.Println(f.JobTitle())
Output:

Director

func (*Faker) Language

func (f *Faker) Language() string

Language will return a random language

Example
f := New(11)
fmt.Println(f.Language())
Output:

Kazakh

func (*Faker) LanguageAbbreviation

func (f *Faker) LanguageAbbreviation() string

LanguageAbbreviation will return a random language abbreviation

Example
f := New(11)
fmt.Println(f.LanguageAbbreviation())
Output:

kk

func (*Faker) LanguageBCP added in v6.7.0

func (f *Faker) LanguageBCP() string

LanguageBCP will return a random language BCP (Best Current Practices)

Example
f := New(11)
fmt.Println(f.LanguageBCP())
Output:

de-DE

func (*Faker) LastName

func (f *Faker) LastName() string

LastName will generate a random last name

Example
f := New(11)
fmt.Println(f.LastName())
Output:

Daniel

func (*Faker) Latitude

func (f *Faker) Latitude() float64

Latitude will generate a random latitude float64

Example
f := New(11)
fmt.Println(f.Latitude())
Output:

-73.534057

func (*Faker) LatitudeInRange

func (f *Faker) LatitudeInRange(min, max float64) (float64, error)

LatitudeInRange will generate a random latitude within the input range

Example
f := New(11)
lat, _ := f.LatitudeInRange(21, 42)
fmt.Println(lat)
Output:

22.921026

func (*Faker) Letter

func (f *Faker) Letter() string

Letter will generate a single random lower case ASCII letter

Example
f := New(11)
fmt.Println(f.Letter())
Output:

g

func (*Faker) LetterN

func (f *Faker) LetterN(n uint) string

LetterN will generate a random ASCII string with length N. Note that this function returns a string with a length of 1 when 0 is passed.

Example
f := New(11)
fmt.Println(f.LetterN(10))
Output:

gbRMaRxHki

func (*Faker) Lexify

func (f *Faker) Lexify(str string) string

Lexify will replace ? with random generated letters

Example
f := New(11)
fmt.Println(f.Lexify("?????"))
Output:

gbRMa

func (*Faker) LogLevel

func (f *Faker) LogLevel(logType string) string

LogLevel will generate a random log level See data/LogLevels for list of available levels

Example
f := New(11)
fmt.Println(f.LogLevel("")) // This will also use general
fmt.Println(f.LogLevel("syslog"))
fmt.Println(f.LogLevel("apache"))
Output:

error
debug
trace1-8

func (*Faker) Longitude

func (f *Faker) Longitude() float64

Longitude will generate a random longitude float64

Example
f := New(11)
fmt.Println(f.Longitude())
Output:

-147.068113

func (*Faker) LongitudeInRange

func (f *Faker) LongitudeInRange(min, max float64) (float64, error)

LongitudeInRange will generate a random longitude within the input range

Example
f := New(11)
long, _ := f.LongitudeInRange(-10, 10)
fmt.Println(long)
Output:

-8.170451

func (*Faker) LoremIpsumParagraph

func (f *Faker) LoremIpsumParagraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string

LoremIpsumParagraph will generate a random paragraphGenerator

Example
f := New(11)
fmt.Println(f.LoremIpsumParagraph(3, 5, 12, "\n"))
Output:

Quia quae repellat consequatur quidem nisi quo qui voluptatum accusantium quisquam amet. Quas et ut non dolorem ipsam aut enim assumenda mollitia harum ut. Dicta similique veniam nulla voluptas at excepturi non ad maxime at non. Eaque hic repellat praesentium voluptatem qui consequuntur dolor iusto autem velit aut. Fugit tempore exercitationem harum consequatur voluptatum modi minima aut eaque et et.
Aut ea voluptatem dignissimos expedita odit tempore quod aut beatae ipsam iste. Minus voluptatibus dolorem maiores eius sed nihil vel enim odio voluptatem accusamus. Natus quibusdam temporibus tenetur cumque sint necessitatibus dolorem ex ducimus iusto ex. Voluptatem neque dicta explicabo officiis et ducimus sit ut ut praesentium pariatur. Illum molestias nisi at dolore ut voluptatem accusantium et fugiat et ut.
Explicabo incidunt reprehenderit non quia dignissimos recusandae vitae soluta quia et quia. Aut veniam voluptas consequatur placeat sapiente non eveniet voluptatibus magni velit eum. Nobis vel repellendus sed est qui autem laudantium quidem quam ullam consequatur. Aut iusto ut commodi similique quae voluptatem atque qui fugiat eum aut. Quis distinctio consequatur voluptatem vel aliquid aut laborum facere officiis iure tempora.

func (*Faker) LoremIpsumSentence

func (f *Faker) LoremIpsumSentence(wordCount int) string

LoremIpsumSentence will generate a random sentence

Example
f := New(11)
fmt.Println(f.LoremIpsumSentence(5))
Output:

Quia quae repellat consequatur quidem.

func (*Faker) LoremIpsumWord

func (f *Faker) LoremIpsumWord() string

LoremIpsumWord will generate a random word

Example
f := New(11)
fmt.Println(f.LoremIpsumWord())
Output:

quia

func (*Faker) Lunch

func (f *Faker) Lunch() string

Lunch will return a random lunch name

Example
f := New(11)
fmt.Println(f.Lunch())
Output:

No bake hersheys bar pie

func (*Faker) MacAddress

func (f *Faker) MacAddress() string

MacAddress will generate a random mac address

Example
f := New(11)
fmt.Println(f.MacAddress())
Output:

e1:74:cb:01:77:91

func (*Faker) Map

func (f *Faker) Map() map[string]any

Map will generate a random set of map data

Example
f := New(11)
fmt.Println(f.Map())
Output:

map[here:Manager herself:map[trip:[far computer was unless whom riches]] how:8504801 ouch:Keith Ullrich outstanding:1860846 that:web services]

func (*Faker) Markdown added in v6.25.0

func (f *Faker) Markdown(co *MarkdownOptions) (string, error)

Markdown will return a single random Markdown template document

Example
f := New(11)

value, err := f.Markdown(&MarkdownOptions{})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

	# PurpleSheep5

*Author: Amie Feil*

Was by army party riches theirs instead. Here mine whichever that those instance growth. Has ouch enough Swiss us since down. He she aha us you to upon. How this this furniture way no play.

Towel that us to accordingly theirs purse. Enough so though election often until eek. Weekly yet oops until conclude his stay. Elsewhere such that galaxy clean that last. Each stack reluctantly theirs wisp aid firstly.

## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [License](#license)

## Installation
'''bash
pip install PurpleSheep5
'''

## Usage
'''python
result = purplesheep5.process("funny request")
print("purplesheep5 result:", "in progress")
'''

## License
MIT

func (*Faker) MiddleName added in v6.22.0

func (f *Faker) MiddleName() string

MiddleName will generate a random middle name

Example
f := New(11)
fmt.Println(f.MiddleName())
Output:

Belinda

func (*Faker) MinecraftAnimal added in v6.11.0

func (f *Faker) MinecraftAnimal() string

MinecraftAnimal will generate a random Minecraft animal

Example
f := New(11)
fmt.Println(f.MinecraftAnimal())
Output:

chicken

func (*Faker) MinecraftArmorPart added in v6.11.0

func (f *Faker) MinecraftArmorPart() string

MinecraftArmorPart will generate a random Minecraft armor part

Example
f := New(11)
fmt.Println(f.MinecraftArmorPart())
Output:

helmet

func (*Faker) MinecraftArmorTier added in v6.11.0

func (f *Faker) MinecraftArmorTier() string

MinecraftArmorTier will generate a random Minecraft armor tier

Example
f := New(11)
fmt.Println(f.MinecraftArmorTier())
Output:

leather

func (*Faker) MinecraftBiome added in v6.11.0

func (f *Faker) MinecraftBiome() string

MinecraftBiome will generate a random Minecraft biome

Example
f := New(11)
fmt.Println(f.MinecraftBiome())
Output:

stone shore

func (*Faker) MinecraftDye added in v6.11.0

func (f *Faker) MinecraftDye() string

MinecraftDye will generate a random Minecraft dye

Example
f := New(11)
fmt.Println(f.MinecraftDye())
Output:

light gray

func (*Faker) MinecraftFood added in v6.11.0

func (f *Faker) MinecraftFood() string

MinecraftFood will generate a random Minecraft food

Example
f := New(11)
fmt.Println(f.MinecraftFood())
Output:

beetroot

func (*Faker) MinecraftMobBoss added in v6.11.0

func (f *Faker) MinecraftMobBoss() string

MinecraftMobBoss will generate a random Minecraft mob boss

Example
f := New(11)
fmt.Println(f.MinecraftMobBoss())
Output:

ender dragon

func (*Faker) MinecraftMobHostile added in v6.11.0

func (f *Faker) MinecraftMobHostile() string

MinecraftMobHostile will generate a random Minecraft mob hostile

Example
f := New(11)
fmt.Println(f.MinecraftMobHostile())
Output:

blaze

func (*Faker) MinecraftMobNeutral added in v6.11.0

func (f *Faker) MinecraftMobNeutral() string

MinecraftMobNeutral will generate a random Minecraft mob neutral

Example
f := New(11)
fmt.Println(f.MinecraftMobNeutral())
Output:

wolf

func (*Faker) MinecraftMobPassive added in v6.11.0

func (f *Faker) MinecraftMobPassive() string

MinecraftMobPassive will generate a random Minecraft mob passive

Example
f := New(11)
fmt.Println(f.MinecraftMobPassive())
Output:

chicken

func (*Faker) MinecraftOre added in v6.11.0

func (f *Faker) MinecraftOre() string

MinecraftOre will generate a random Minecraft ore

Example
f := New(11)
fmt.Println(f.MinecraftOre())
Output:

coal

func (*Faker) MinecraftTool added in v6.11.0

func (f *Faker) MinecraftTool() string

MinecraftTool will generate a random Minecraft tool

Example
f := New(11)
fmt.Println(f.MinecraftTool())
Output:

pickaxe

func (*Faker) MinecraftVillagerJob added in v6.11.0

func (f *Faker) MinecraftVillagerJob() string

MinecraftVillagerJob will generate a random Minecraft villager job

Example
f := New(11)
fmt.Println(f.MinecraftVillagerJob())
Output:

toolsmith

func (*Faker) MinecraftVillagerLevel added in v6.11.0

func (f *Faker) MinecraftVillagerLevel() string

MinecraftVillagerLevel will generate a random Minecraft villager level

Example
f := New(11)
fmt.Println(f.MinecraftVillagerLevel())
Output:

novice

func (*Faker) MinecraftVillagerStation added in v6.11.0

func (f *Faker) MinecraftVillagerStation() string

MinecraftVillagerStation will generate a random Minecraft villager station

Example
f := New(11)
fmt.Println(f.MinecraftVillagerStation())
Output:

cauldron

func (*Faker) MinecraftWeapon added in v6.11.0

func (f *Faker) MinecraftWeapon() string

MinecraftWeapon will generate a random Minecraft weapon

Example
f := New(11)
fmt.Println(f.MinecraftWeapon())
Output:

sword

func (*Faker) MinecraftWeather added in v6.11.0

func (f *Faker) MinecraftWeather() string

MinecraftWeather will generate a random Minecraft weather

Example
f := New(11)
fmt.Println(f.MinecraftWeather())
Output:

clear

func (*Faker) MinecraftWood added in v6.11.0

func (f *Faker) MinecraftWood() string

MinecraftWood will generate a random Minecraft wood

Example
f := New(11)
fmt.Println(f.MinecraftWood())
Output:

oak

func (*Faker) Minute

func (f *Faker) Minute() int

Minute will generate a random minute

Example
f := New(11)
fmt.Println(f.Minute())
Output:

5

func (*Faker) Month

func (f *Faker) Month() int

Month will generate a random month int

Example
f := New(11)
fmt.Println(f.Month())
Output:

6

func (*Faker) MonthString added in v6.3.0

func (f *Faker) MonthString() string

MonthString will generate a random month string

Example
f := New(11)
fmt.Println(f.MonthString())
Output:

June

func (*Faker) Movie added in v6.22.0

func (f *Faker) Movie() *MovieInfo
Example
f := New(11)
movie := f.Movie()
fmt.Println(movie.Name)
fmt.Println(movie.Genre)
Output:

Psycho
Mystery

func (*Faker) MovieGenre added in v6.22.0

func (f *Faker) MovieGenre() string
Example
f := New(11)
fmt.Println(f.MovieGenre())
Output:

Music

func (*Faker) MovieName added in v6.22.0

func (f *Faker) MovieName() string
Example
f := New(11)
fmt.Println(f.MovieName())
Output:

Psycho

func (*Faker) Name

func (f *Faker) Name() string

Name will generate a random First and Last Name

Example
f := New(11)
fmt.Println(f.Name())
Output:

Markus Moen

func (*Faker) NamePrefix

func (f *Faker) NamePrefix() string

NamePrefix will generate a random name prefix

Example
f := New(11)
fmt.Println(f.NamePrefix())
Output:

Mr.

func (*Faker) NameSuffix

func (f *Faker) NameSuffix() string

NameSuffix will generate a random name suffix

Example
f := New(11)
fmt.Println(f.NameSuffix())
Output:

Jr.

func (*Faker) NanoSecond

func (f *Faker) NanoSecond() int

NanoSecond will generate a random nano second

Example
f := New(11)
fmt.Println(f.NanoSecond())
Output:

693298265

func (*Faker) NiceColors added in v6.20.0

func (f *Faker) NiceColors() []string

NiceColor will generate a random safe color string

Example
f := New(11)
fmt.Println(f.NiceColors())
Output:

[#f6f6f6 #e8e8e8 #333333 #990100 #b90504]

func (*Faker) Noun

func (f *Faker) Noun() string

Noun will generate a random noun

Example
f := New(11)
fmt.Println(f.Noun())
Output:

aunt

func (*Faker) NounAbstract added in v6.11.0

func (f *Faker) NounAbstract() string

NounAbstract will generate a random abstract noun

Example
f := New(11)
fmt.Println(f.NounAbstract())
Output:

confusion

func (*Faker) NounCollectiveAnimal added in v6.11.0

func (f *Faker) NounCollectiveAnimal() string

NounCollectiveAnimal will generate a random collective noun animal

Example
f := New(11)
fmt.Println(f.NounCollectiveAnimal())
Output:

party

func (*Faker) NounCollectivePeople added in v6.11.0

func (f *Faker) NounCollectivePeople() string

NounCollectivePeople will generate a random collective noun person

Example
f := New(11)
fmt.Println(f.NounCollectivePeople())
Output:

body

func (*Faker) NounCollectiveThing added in v6.11.0

func (f *Faker) NounCollectiveThing() string

NounCollectiveThing will generate a random collective noun thing

Example
f := New(11)
fmt.Println(f.NounCollectiveThing())
Output:

hand

func (*Faker) NounCommon added in v6.11.0

func (f *Faker) NounCommon() string

NounCommon will generate a random common noun

Example
f := New(11)
fmt.Println(f.NounCommon())
Output:

part

func (*Faker) NounConcrete added in v6.11.0

func (f *Faker) NounConcrete() string

NounConcrete will generate a random concrete noun

Example
f := New(11)
fmt.Println(f.NounConcrete())
Output:

snowman

func (*Faker) NounCountable added in v6.11.0

func (f *Faker) NounCountable() string

NounCountable will generate a random countable noun

Example
f := New(11)
fmt.Println(f.NounCountable())
Output:

neck

func (*Faker) NounDeterminer added in v6.28.0

func (f *Faker) NounDeterminer() string

NounDeterminer will generate a random noun determiner

Example
f := New(11)
fmt.Println(f.NounDeterminer())
Output:

an

func (*Faker) NounProper added in v6.11.0

func (f *Faker) NounProper() string

NounProper will generate a random proper noun

Example
f := New(11)
fmt.Println(f.NounProper())
Output:

Marcel

func (*Faker) NounUncountable added in v6.11.0

func (f *Faker) NounUncountable() string

NounUncountable will generate a random uncountable noun

Example
f := New(11)
fmt.Println(f.NounUncountable())
Output:

seafood

func (*Faker) Number

func (f *Faker) Number(min int, max int) int

Number will generate a random number between given min And max

Example
f := New(11)
fmt.Println(f.Number(50, 23456))
Output:

12583

func (*Faker) Numerify

func (f *Faker) Numerify(str string) string

Numerify will replace # with random numerical values

Example
f := New(11)
fmt.Println(f.Numerify("###-###-####"))
Output:

613-645-9948

func (*Faker) OperaUserAgent

func (f *Faker) OperaUserAgent() string

OperaUserAgent will generate a random opera browser user agent string

Example
f := New(11)
fmt.Println(f.OperaUserAgent())
Output:

Opera/8.20 (Macintosh; U; PPC Mac OS X 10_9_10; en-US) Presto/2.9.198 Version/11.00

func (*Faker) Paragraph

func (f *Faker) Paragraph(paragraphCount int, sentenceCount int, wordCount int, separator string) string

Paragraph will generate a random paragraphGenerator

Example
f := New(11)
fmt.Println(f.Paragraph(3, 5, 12, "\n"))
Output:

None how these keep trip Congolese choir computer still far unless army. Party riches theirs instead here mine whichever that those instance growth has. Ouch enough Swiss us since down he she aha us you to. Upon how this this furniture way no play towel that us to. Accordingly theirs purse enough so though election often until eek weekly yet.
Oops until conclude his stay elsewhere such that galaxy clean that last. Each stack reluctantly theirs wisp aid firstly highly butter accordingly should already. Calm shake according fade neither kuban upon this he fortnightly occasionally bunch. On who elsewhere lastly hourly right there honesty we is how result. Out Shakespearean have whom yearly another packet are behind late lot finally.
Time themselves goodness quizzical our therefore could fact cackle yourselves zebra for. Whose enormously all bowl out wandering secondly yellow another your hourly spit. Since tomorrow hers words little think will our by Polynesian write much. Of herself uptight these composer these any firstly stack you much terribly. Over pose place sprint it child is joyously that I whom mango.

func (*Faker) Password

func (f *Faker) Password(lower bool, upper bool, numeric bool, special bool, space bool, num int) string

Password will generate a random password. Minimum number length of 5 if less than.

Example
f := New(11)
fmt.Println(f.Password(true, false, false, false, false, 32))
fmt.Println(f.Password(false, true, false, false, false, 32))
fmt.Println(f.Password(false, false, true, false, false, 32))
fmt.Println(f.Password(false, false, false, true, false, 32))
fmt.Println(f.Password(true, true, true, true, true, 32))
fmt.Println(f.Password(true, true, true, true, true, 4))
Output:

vodnqxzsuptgehrzylximvylxzoywexw
ZSRQWJFJWCSTVGXKYKWMLIAFGFELFJRG
61718615932495608398906260648432
!*&#$$??_!&!#.@@-!_!!$$-?_$&.@-&
d6UzSwXvJ81 7QPvlse@l ln VmvU5jd
UKTn2

func (*Faker) PastDate added in v6.27.0

func (f *Faker) PastDate() time.Time

FutureDate will generate a random past time.Time struct

Example
f := New(11)
fmt.Println(f.PastDate())
Output:

func (*Faker) Person

func (f *Faker) Person() *PersonInfo

Person will generate a struct with person information

Example
f := New(11)
person := f.Person()
job := person.Job
address := person.Address
contact := person.Contact
creditCard := person.CreditCard

fmt.Println(person.FirstName)
fmt.Println(person.LastName)
fmt.Println(person.Gender)
fmt.Println(person.SSN)
fmt.Println(person.Image)
fmt.Println(person.Hobby)

fmt.Println(job.Company)
fmt.Println(job.Title)
fmt.Println(job.Descriptor)
fmt.Println(job.Level)

fmt.Println(address.Address)
fmt.Println(address.Street)
fmt.Println(address.City)
fmt.Println(address.State)
fmt.Println(address.Zip)
fmt.Println(address.Country)
fmt.Println(address.Latitude)
fmt.Println(address.Longitude)

fmt.Println(contact.Phone)
fmt.Println(contact.Email)

fmt.Println(creditCard.Type)
fmt.Println(creditCard.Number)
fmt.Println(creditCard.Exp)
fmt.Println(creditCard.Cvv)
Output:

Markus
Moen
male
275413589
https://picsum.photos/208/500
Lacrosse
Intermap Technologies
Developer
Direct
Paradigm
369 North Cornerbury, Miami, North Dakota 24259
369 North Cornerbury
Miami
North Dakota
24259
Ghana
-6.662595
23.921575
3023202027
lamarkoelpin@heaney.biz
Maestro
39800889982276
01/30
932

func (*Faker) PetName

func (f *Faker) PetName() string

PetName will return a random fun pet name

Example
f := New(11)
fmt.Println(f.PetName())
Output:

Ozzy Pawsborne

func (*Faker) Phone

func (f *Faker) Phone() string

Phone will generate a random phone number string

Example
f := New(11)
fmt.Println(f.Phone())
Output:

6136459948

func (*Faker) PhoneFormatted

func (f *Faker) PhoneFormatted() string

PhoneFormatted will generate a random phone number string

Example
f := New(11)
fmt.Println(f.PhoneFormatted())
Output:

136-459-9489

func (*Faker) Phrase

func (f *Faker) Phrase() string

Phrase will return a random phrase

Example
f := New(11)
fmt.Println(f.Phrase())
Output:

horses for courses

func (*Faker) PhraseAdverb added in v6.11.0

func (f *Faker) PhraseAdverb() string

PhraseAdverb will return a random adverb phrase

Example
f := New(11)
fmt.Println(f.PhraseAdverb())
Output:

fully gladly

func (*Faker) PhraseNoun added in v6.11.0

func (f *Faker) PhraseNoun() string

PhraseNoun will return a random noun phrase

Example
f := New(11)
fmt.Println(f.PhraseNoun())
Output:

the purple tribe

func (*Faker) PhrasePreposition added in v6.11.0

func (f *Faker) PhrasePreposition() string

PhrasePreposition will return a random preposition phrase

Example
f := New(11)
fmt.Println(f.PhrasePreposition())
Output:

out the tribe

func (*Faker) PhraseVerb added in v6.11.0

func (f *Faker) PhraseVerb() string

PhraseVerb will return a random preposition phrase

Example
f := New(11)
fmt.Println(f.PhraseVerb())
Output:

gladly dream indeed swiftly till a problem poorly

func (*Faker) Preposition

func (f *Faker) Preposition() string

Preposition will generate a random preposition

Example
f := New(11)
fmt.Println(f.Preposition())
Output:

other than

func (*Faker) PrepositionCompound added in v6.11.0

func (f *Faker) PrepositionCompound() string

PrepositionCompound will generate a random compound preposition

Example
f := New(11)
fmt.Println(f.PrepositionCompound())
Output:

according to

func (*Faker) PrepositionDouble added in v6.11.0

func (f *Faker) PrepositionDouble() string

PrepositionDouble will generate a random double preposition

Example
f := New(11)
fmt.Println(f.PrepositionDouble())
Output:

before

func (*Faker) PrepositionSimple added in v6.11.0

func (f *Faker) PrepositionSimple() string

PrepositionSimple will generate a random simple preposition

Example
f := New(11)
fmt.Println(f.PrepositionSimple())
Output:

out

func (*Faker) Price

func (f *Faker) Price(min, max float64) float64

Price will take in a min and max value and return a formatted price

Example
f := New(11)
fmt.Printf("%.2f", f.Price(0.8618, 1000))
Output:

92.26

func (*Faker) Product added in v6.26.0

func (f *Faker) Product() *ProductInfo

Product will generate a random set of product information

Example
f := New(11)
product := f.Product()
fmt.Println(product.Name)
fmt.Println(product.Description)
fmt.Println(product.Categories)
fmt.Println(product.Price)
fmt.Println(product.Features)
fmt.Println(product.Color)
fmt.Println(product.Material)
fmt.Println(product.UPC)
Output:

Olive Copper Monitor
Choir computer still far unless army party riches theirs instead here. Whichever that those instance growth has ouch enough Swiss us since down he. Aha us you to upon how this this furniture way no play towel.
[clothing tools and hardware]
41.61
[ultra-lightweight]
olive
stainless
074937734366

func (*Faker) ProductCategory added in v6.26.0

func (f *Faker) ProductCategory() string

ProductCategory will generate a random product category

Example
f := New(11)
fmt.Println(f.ProductCategory())
Output:

pet supplies

func (*Faker) ProductDescription added in v6.26.0

func (f *Faker) ProductDescription() string

ProductDescription will generate a random product description

Example
f := New(11)
fmt.Println(f.ProductDescription())
Output:

How these keep trip Congolese choir computer still far unless army party riches theirs instead. Mine whichever that those instance. Has ouch enough Swiss us since down.

func (*Faker) ProductFeature added in v6.26.0

func (f *Faker) ProductFeature() string

ProductFeature will generate a random product feature

Example
f := New(11)
fmt.Println(f.ProductFeature())
Output:

wireless

func (*Faker) ProductMaterial added in v6.26.0

func (f *Faker) ProductMaterial() string

ProductMaterial will generate a random product material

Example
f := New(11)
fmt.Println(f.ProductMaterial())
Output:

silicon

func (*Faker) ProductName added in v6.26.0

func (f *Faker) ProductName() string

ProductName will generate a random product name

Example
f := New(11)
fmt.Println(f.ProductName())
Output:

Appliance Pulse Leather

func (*Faker) ProductUPC added in v6.26.0

func (f *Faker) ProductUPC() string

ProductUPC will generate a random product UPC

Example
f := New(11)
fmt.Println(f.ProductUPC())
Output:

056990598130

func (*Faker) ProgrammingLanguage

func (f *Faker) ProgrammingLanguage() string

ProgrammingLanguage will return a random programming language

Example
f := New(464)
fmt.Println(f.ProgrammingLanguage())
Output:

Go

func (*Faker) ProgrammingLanguageBest

func (f *Faker) ProgrammingLanguageBest() string

ProgrammingLanguageBest will return a random programming language

Example
f := New(11)
fmt.Println(f.ProgrammingLanguageBest())
Output:

Go

func (*Faker) Pronoun added in v6.11.0

func (f *Faker) Pronoun() string

Pronoun will generate a random pronoun

Example
f := New(11)
fmt.Println(f.Pronoun())
Output:

me

func (*Faker) PronounDemonstrative added in v6.11.0

func (f *Faker) PronounDemonstrative() string

PronounDemonstrative will generate a random demonstrative pronoun

Example
f := New(11)
fmt.Println(f.PronounDemonstrative())
Output:

this

func (*Faker) PronounIndefinite added in v6.11.0

func (f *Faker) PronounIndefinite() string

PronounIndefinite will generate a random indefinite pronoun

Example
f := New(11)
fmt.Println(f.PronounIndefinite())
Output:

few

func (*Faker) PronounInterrogative added in v6.11.0

func (f *Faker) PronounInterrogative() string

PronounInterrogative will generate a random interrogative pronoun

Example
f := New(11)
fmt.Println(f.PronounInterrogative())
Output:

what

func (*Faker) PronounObject added in v6.11.0

func (f *Faker) PronounObject() string

PronounObject will generate a random object pronoun

Example
f := New(11)
fmt.Println(f.PronounObject())
Output:

it

func (*Faker) PronounPersonal added in v6.11.0

func (f *Faker) PronounPersonal() string

PronounPersonal will generate a random personal pronoun

Example
f := New(11)
fmt.Println(f.PronounPersonal())
Output:

it

func (*Faker) PronounPossessive added in v6.11.0

func (f *Faker) PronounPossessive() string

PronounPossessive will generate a random possessive pronoun

Example
f := New(11)
fmt.Println(f.PronounPossessive())
Output:

mine

func (*Faker) PronounReflective added in v6.11.0

func (f *Faker) PronounReflective() string

PronounReflective will generate a random reflective pronoun

Example
f := New(11)
fmt.Println(f.PronounReflective())
Output:

myself

func (*Faker) PronounRelative added in v6.11.0

func (f *Faker) PronounRelative() string

PronounRelative will generate a random relative pronoun

Example
f := New(11)
fmt.Println(f.PronounRelative())
Output:

as

func (*Faker) Question

func (f *Faker) Question() string

Question will return a random question

Example
f := New(11)
fmt.Println(f.Question())
Output:

Roof chia echo pickled?

func (*Faker) Quote

func (f *Faker) Quote() string

Quote will return a random quote from a random person

Example
f := New(11)
fmt.Println(f.Quote())
Output:

"Roof chia echo pickled." - Marques Jakubowski

func (*Faker) RGBColor

func (f *Faker) RGBColor() []int

RGBColor will generate a random int slice color

Example
f := New(11)
fmt.Println(f.RGBColor())
Output:

[89 176 195]

func (*Faker) RandomInt

func (f *Faker) RandomInt(i []int) int

RandomInt will take in a slice of int and return a randomly selected value

Example
f := New(11)

ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657}
fmt.Println(f.RandomInt(ints))
Output:

52

func (*Faker) RandomMapKey added in v6.11.0

func (f *Faker) RandomMapKey(mapI any) any

RandomMapKey will return a random key from a map

func (*Faker) RandomString

func (f *Faker) RandomString(a []string) string

RandomString will take in a slice of string and return a randomly selected value

Example
f := New(11)
fmt.Println(f.RandomString([]string{"hello", "world"}))
Output:

hello

func (*Faker) RandomUint

func (f *Faker) RandomUint(u []uint) uint

RandomUint will take in a slice of uint and return a randomly selected value

Example
f := New(11)

ints := []uint{52, 854, 941, 74125, 8413, 777, 89416, 841657}
fmt.Println(f.RandomUint(ints))
Output:

52

func (*Faker) Regex

func (f *Faker) Regex(regexStr string) string

Regex will generate a string based upon a RE2 syntax

Example
f := New(11)

fmt.Println(f.Regex("[abcdef]{5}"))
fmt.Println(f.Regex("[[:upper:]]{5}"))
fmt.Println(f.Regex("(hello|world|whats|up)"))
fmt.Println(f.Regex(`^[a-z]{5,10}@[a-z]{5,10}\.(com|net|org)$`))
Output:

affec
RXHKI
world
tapwyjdnsm@gtlxw.net

func (*Faker) SQL added in v6.16.0

func (f *Faker) SQL(so *SQLOptions) (string, error)
Example
f := New(11)

res, _ := f.SQL(&SQLOptions{
	Table: "people",
	Count: 2,
	Fields: []Field{
		{Name: "id", Function: "autoincrement"},
		{Name: "first_name", Function: "firstname"},
		{Name: "price", Function: "price"},
		{Name: "age", Function: "number", Params: MapParams{"min": {"1"}, "max": {"99"}}},
		{Name: "created_at", Function: "date", Params: MapParams{"format": {"2006-01-02 15:04:05"}}},
	},
})

fmt.Println(string(res))
Output:

INSERT INTO people (id, first_name, price, age, created_at) VALUES (1, 'Markus', 804.92, 21, '1901-11-22 07:34:00'),(2, 'Anibal', 674.87, 60, '2006-01-03 11:07:53');

func (*Faker) SSN

func (f *Faker) SSN() string

SSN will generate a random Social Security Number

Example
f := New(11)
fmt.Println(f.SSN())
Output:

493298265

func (*Faker) SafariUserAgent

func (f *Faker) SafariUserAgent() string

SafariUserAgent will generate a random safari browser user agent string

Example
f := New(11)
fmt.Println(f.SafariUserAgent())
Output:

Mozilla/5.0 (iPad; CPU OS 7_0_2 like Mac OS X; en-US) AppleWebKit/536.4.4 (KHTML, like Gecko) Version/3.0.5 Mobile/8B120 Safari/6536.4.4

func (*Faker) SafeColor

func (f *Faker) SafeColor() string

SafeColor will generate a random safe color string

Example
f := New(11)
fmt.Println(f.SafeColor())
Output:

black

func (*Faker) School added in v6.25.0

func (f *Faker) School() string
Example
f := New(11)
fmt.Println(f.School())
Output:

Harborview State Academy

func (*Faker) Second

func (f *Faker) Second() int

Second will generate a random second

Example
f := New(11)
fmt.Println(f.Second())
Output:

5

func (*Faker) Sentence

func (f *Faker) Sentence(wordCount int) string

Sentence will generate a random sentence

Example
f := New(11)
fmt.Println(f.Sentence(5))
Output:

None how these keep trip.

func (*Faker) SentenceSimple added in v6.11.0

func (f *Faker) SentenceSimple() string

SentenceSimple will generate a random simple sentence

Example
f := New(11)
fmt.Println(f.SentenceSimple())
Output:

The purple tribe indeed swiftly laugh.

func (*Faker) ShuffleAnySlice

func (f *Faker) ShuffleAnySlice(v any)

ShuffleAnySlice takes in a slice and outputs it in a random order

Example
f := New(11)

strings := []string{"happy", "times", "for", "everyone", "have", "a", "good", "day"}
f.ShuffleAnySlice(strings)
fmt.Println(strings)

ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657}
f.ShuffleAnySlice(ints)
fmt.Println(ints)
Output:

[good everyone have for times a day happy]
[777 74125 941 854 89416 52 8413 841657]

func (*Faker) ShuffleInts

func (f *Faker) ShuffleInts(a []int)

ShuffleInts will randomize a slice of ints

Example
f := New(11)

ints := []int{52, 854, 941, 74125, 8413, 777, 89416, 841657}
f.ShuffleInts(ints)
fmt.Println(ints)
Output:

[74125 777 941 89416 8413 854 52 841657]

func (*Faker) ShuffleStrings

func (f *Faker) ShuffleStrings(a []string)

ShuffleStrings will randomize a slice of strings

Example
f := New(11)
strings := []string{"happy", "times", "for", "everyone", "have", "a", "good", "day"}
f.ShuffleStrings(strings)
fmt.Println(strings)
Output:

[good everyone have for times a day happy]

func (*Faker) Slice added in v6.2.0

func (f *Faker) Slice(v any)

Slice fills built-in types and exported fields of a struct with random data.

Example
f := New(11)

var S []string
f.Slice(&S)

I := make([]int8, 3)
f.Slice(&I)

fmt.Println(S)
fmt.Println(I)
Output:

[RMaRxHkiJ PtapWYJdn MKgtlxwnq qclaYkWw oRLOPxLIok qanPAKaXS]
[-88 -101 60]
Example (Struct)
f := New(11)

type Basic struct {
	S string `fake:"{firstname}"`
	I int
	F float32
}

var B []Basic
f.Slice(&B)

fmt.Println(B)
Output:

[{Marcel -1697368647228132669 1.9343967e+38} {Lura 1052100795806789315 2.670526e+38} {Lucinda 4409580151121052361 1.0427679e+38} {Santino 2168696190310795206 2.2573786e+38} {Dawn 3859340644268985534 4.249854e+37} {Alice 9082579350789565885 1.0573345e+38}]

func (*Faker) Slogan added in v6.22.0

func (f *Faker) Slogan() string

Slogan will generate a random company slogan

Example
f := New(11)
fmt.Println(f.Slogan())
Output:

Universal seamless Focus, interactive.

func (*Faker) Snack

func (f *Faker) Snack() string

Snack will return a random snack name

Example
f := New(11)
fmt.Println(f.Snack())
Output:

Hoisin marinated wing pieces

func (*Faker) State

func (f *Faker) State() string

State will generate a random state string

Example
f := New(11)
fmt.Println(f.State())
Output:

Hawaii

func (*Faker) StateAbr

func (f *Faker) StateAbr() string

StateAbr will generate a random abbreviated state string

Example
f := New(11)
fmt.Println(f.StateAbr())
Output:

CO

func (*Faker) Street

func (f *Faker) Street() string

Street will generate a random address street string

Example
f := New(11)
fmt.Println(f.Street())
Output:

364 Unionsville

func (*Faker) StreetName

func (f *Faker) StreetName() string

StreetName will generate a random address street name string

Example
f := New(11)
fmt.Println(f.StreetName())
Output:

View

func (*Faker) StreetNumber

func (f *Faker) StreetNumber() string

StreetNumber will generate a random address street number string

Example
f := New(11)
fmt.Println(f.StreetNumber())
Output:

13645

func (*Faker) StreetPrefix

func (f *Faker) StreetPrefix() string

StreetPrefix will generate a random address street prefix string

Example
f := New(11)
fmt.Println(f.StreetPrefix())
Output:

Lake

func (*Faker) StreetSuffix

func (f *Faker) StreetSuffix() string

StreetSuffix will generate a random address street suffix string

Example
f := New(11)
fmt.Println(f.StreetSuffix())
Output:

land

func (*Faker) Struct

func (f *Faker) Struct(v any) error

Struct fills in exported fields of a struct with random data based on the value of `fake` tag of exported fields. Use `fake:"skip"` to explicitly skip an element. All built-in types are supported, with templating support for string types.

Example
fake := New(11)

type Bar struct {
	Name   string
	Number int
	Float  float32
}

type Foo struct {
	Str        string
	Int        int
	Pointer    *int
	Name       string            `fake:"{firstname}"`
	Number     string            `fake:"{number:1,10}"`
	Skip       *string           `fake:"skip"`
	Array      []string          `fakesize:"2"`
	ArrayRange []string          `fakesize:"2,6"`
	Map        map[string]string `fakesize:"2"`
	MapRange   map[string]string `fakesize:"2,4"`
	Bar        Bar
}

var f Foo
fake.Struct(&f)

fmt.Printf("%s\n", f.Str)
fmt.Printf("%d\n", f.Int)
fmt.Printf("%d\n", *f.Pointer)
fmt.Printf("%v\n", f.Name)
fmt.Printf("%v\n", f.Number)
fmt.Printf("%v\n", f.Skip)
fmt.Printf("%v\n", f.Array)
fmt.Printf("%v\n", f.Map)
fmt.Printf("%v\n", f.MapRange)
fmt.Printf("%+v\n", f.Bar)
Output:

bRMaRx
8474499440427634498
4409580151121052361
Andre
1
<nil>
[PtapWYJdn MKgtlxwnq]
map[DjRRGUns:xdBXGY yvqqdH:eUxcvUVS]
map[Oyrwg:LhewLkDVtD XpYcnVTKpB:eubY jQZsZt:eUpXhOq ynojqPYDrH:HWYKFgji]
{Name:ANhYxKtSH Number:-5807586752746953977 Float:4.558046e+37}
Example (Array)
f := New(11)

type Foo struct {
	Bar    string
	Int    int
	Name   string  `fake:"{firstname}"`
	Number string  `fake:"{number:1,10}"`
	Skip   *string `fake:"skip"`
}

type FooMany struct {
	Foos       []Foo    `fakesize:"1"`
	Names      []string `fake:"{firstname}" fakesize:"3"`
	NamesRange []string `fake:"{firstname}" fakesize:"3,6"`
}

var fm FooMany
f.Struct(&fm)

fmt.Printf("%v\n", fm.Foos)
fmt.Printf("%v\n", fm.Names)
fmt.Printf("%v\n", fm.NamesRange)
Output:

[{bRMaRx 8474499440427634498 Paolo 4 <nil>}]
[Santino Carole Enrique]
[Zachery Amie Alice Zachary]

func (*Faker) Svg added in v6.20.0

func (f *Faker) Svg(options *SVGOptions) string

Generate a random svg generator

Example
f := New(11)
fmt.Println(f.Svg(nil))
Output:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 420 496" width="420" height="496"><rect x="0" y="0" width="100%" height="100%" fill="#4f2958" /><polygon points="382,87 418,212 415,110" fill="#fffbb7" /><polygon points="283,270 225,264 411,352" fill="#5b7c8d" /><polygon points="147,283 388,2 117,263" fill="#4f2958" /><polygon points="419,123 71,282 56,55" fill="#fffbb7" /><polygon points="54,451 377,89 52,351" fill="#66b6ab" /><polygon points="395,169 397,256 110,208" fill="#5b7c8d" /><polygon points="222,52 96,147 107,296" fill="#66b6ab" /><polygon points="126,422 57,93 43,221" fill="#fffbb7" /><polygon points="126,125 61,130 348,57" fill="#5b7c8d" /><polygon points="26,235 97,182 58,37" fill="#a6f6af" /><polygon points="190,495 407,44 53,79" fill="#66b6ab" /></svg>

func (*Faker) Teams

func (f *Faker) Teams(peopleArray []string, teamsArray []string) map[string][]string

Teams takes in an array of people and team names and randomly places the people into teams as evenly as possible

Example
f := New(11)
fmt.Println(f.Teams(
	[]string{"Billy", "Sharon", "Jeff", "Connor", "Steve", "Justin", "Fabian", "Robert"},
	[]string{"Team 1", "Team 2", "Team 3"},
))
Output:

map[Team 1:[Fabian Connor Steve] Team 2:[Jeff Sharon Justin] Team 3:[Robert Billy]]

func (*Faker) Template added in v6.25.0

func (f *Faker) Template(template string, co *TemplateOptions) (string, error)

Template generates an document based on the the supplied template

Example
f := New(11)

template := `{{range IntRange 1 4}}{{FirstName}} {{LastName}}\n{{end}}`

value, err := f.Template(template, &TemplateOptions{Data: 4})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

Markus Moen
Alayna Wuckert
Lura Lockman
Sylvan Mraz

func (*Faker) TimeZone

func (f *Faker) TimeZone() string

TimeZone will select a random timezone string

Example
f := New(11)
fmt.Println(f.TimeZone())
Output:

Kaliningrad Standard Time

func (*Faker) TimeZoneAbv

func (f *Faker) TimeZoneAbv() string

TimeZoneAbv will select a random timezone abbreviation string

Example
f := New(11)
fmt.Println(f.TimeZoneAbv())
Output:

KST

func (*Faker) TimeZoneFull

func (f *Faker) TimeZoneFull() string

TimeZoneFull will select a random full timezone string

Example
f := New(11)
fmt.Println(f.TimeZoneFull())
Output:

(UTC+03:00) Kaliningrad, Minsk

func (*Faker) TimeZoneOffset

func (f *Faker) TimeZoneOffset() float32

TimeZoneOffset will select a random timezone offset

Example
f := New(11)
fmt.Println(f.TimeZoneOffset())
Output:

3

func (*Faker) TimeZoneRegion

func (f *Faker) TimeZoneRegion() string

TimeZoneRegion will select a random region style timezone string, e.g. "America/Chicago"

Example
f := New(11)
fmt.Println(f.TimeZoneRegion())
Output:

America/Vancouver

func (*Faker) URL

func (f *Faker) URL() string

URL will generate a random url string

Example
f := New(11)
fmt.Println(f.URL())
Output:

https://www.dynamiciterate.name/target/seamless

func (*Faker) UUID

func (f *Faker) UUID() string

UUID (version 4) will generate a random unique identifier based upon random numbers Format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 8-4-4-4-12

Example
f := New(11)
fmt.Println(f.UUID())
Output:

98173564-6619-4557-888e-65b16bb5def5

func (*Faker) Uint16

func (f *Faker) Uint16() uint16

Uint16 will generate a random uint16 value

Example
f := New(11)
fmt.Println(f.Uint16())
Output:

34968

func (*Faker) Uint32

func (f *Faker) Uint32() uint32

Uint32 will generate a random uint32 value

Example
f := New(11)
fmt.Println(f.Uint32())
Output:

1075055705

func (*Faker) Uint64

func (f *Faker) Uint64() uint64

Uint64 will generate a random uint64 value

Example
f := New(11)
fmt.Println(f.Uint64())
Output:

10067102729548074073

func (*Faker) Uint8

func (f *Faker) Uint8() uint8

Uint8 will generate a random uint8 value

Example
f := New(11)
fmt.Println(f.Uint8())
Output:

152

func (*Faker) UintRange added in v6.10.0

func (f *Faker) UintRange(min, max uint) uint

UintRange will generate a random uint value between min and max

Example
f := New(11)
fmt.Println(f.UintRange(1, 10))
Output:

1

func (*Faker) UserAgent

func (f *Faker) UserAgent() string

UserAgent will generate a random broswer user agent

Example
f := New(11)
fmt.Println(f.UserAgent())
Output:

Mozilla/5.0 (Windows NT 5.0) AppleWebKit/5312 (KHTML, like Gecko) Chrome/40.0.800.0 Mobile Safari/5312

func (*Faker) Username

func (f *Faker) Username() string

Username will generate a random username based upon picking a random lastname and random numbers at the end

Example
f := New(11)
fmt.Println(f.Username())
Output:

Daniel1364

func (*Faker) Vegetable

func (f *Faker) Vegetable() string

Vegetable will return a random vegetable name

Example
f := New(11)
fmt.Println(f.Vegetable())
Output:

Amaranth Leaves

func (*Faker) Verb

func (f *Faker) Verb() string

Verb will generate a random verb

Example
f := New(11)
fmt.Println(f.Verb())
Output:

does

func (*Faker) VerbAction added in v6.11.0

func (f *Faker) VerbAction() string

VerbAction will generate a random action verb

Example
f := New(11)
fmt.Println(f.VerbAction())
Output:

close

func (*Faker) VerbHelping added in v6.11.0

func (f *Faker) VerbHelping() string

VerbHelping will generate a random helping verb

Example
f := New(11)
fmt.Println(f.VerbHelping())
Output:

be

func (*Faker) VerbIntransitive added in v6.11.0

func (f *Faker) VerbIntransitive() string

VerbIntransitive will generate a random intransitive verb

Example
f := New(11)
fmt.Println(f.VerbIntransitive())
Output:

laugh

func (*Faker) VerbLinking added in v6.11.0

func (f *Faker) VerbLinking() string

VerbLinking will generate a random linking verb

Example
f := New(11)
fmt.Println(f.VerbLinking())
Output:

was

func (*Faker) VerbTransitive added in v6.11.0

func (f *Faker) VerbTransitive() string

VerbTransitive will generate a random transitive verb

Example
f := New(11)
fmt.Println(f.VerbTransitive())
Output:

follow

func (*Faker) Vowel added in v6.18.0

func (f *Faker) Vowel() string

Vowel will generate a single random lower case vowel

Example
f := New(11)
fmt.Println(f.Vowel())
Output:

a

func (*Faker) WeekDay

func (f *Faker) WeekDay() string

WeekDay will generate a random weekday string (Monday-Sunday)

Example
f := New(11)
fmt.Println(f.WeekDay())
Output:

Tuesday

func (*Faker) Weighted added in v6.1.0

func (f *Faker) Weighted(options []any, weights []float32) (any, error)

Weighted will take in an array of options and weights and return a random selection based upon its indexed weight

func (*Faker) Word

func (f *Faker) Word() string

Word will generate a random word

Example
f := New(11)
fmt.Println(f.Word())
Output:

none

func (*Faker) XML

func (f *Faker) XML(xo *XMLOptions) ([]byte, error)

XML generates an object or an array of objects in json format A nil XMLOptions returns a randomly structured XML.

Example (Array)
f := New(11)

value, err := f.XML(&XMLOptions{
	Type:          "array",
	RootElement:   "xml",
	RecordElement: "record",
	RowCount:      2,
	Indent:        true,
	Fields: []Field{
		{Name: "first_name", Function: "firstname"},
		{Name: "last_name", Function: "lastname"},
		{Name: "password", Function: "password", Params: MapParams{"special": {"false"}}},
	},
})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

<xml>
    <record>
        <first_name>Markus</first_name>
        <last_name>Moen</last_name>
        <password>856Y5wPZevX9</password>
    </record>
    <record>
        <first_name>Jalon</first_name>
        <last_name>Rolfson</last_name>
        <password>64wz4EAS0Hl0</password>
    </record>
</xml>
Example (Single)
f := New(11)

value, err := f.XML(&XMLOptions{
	Type:          "single",
	RootElement:   "xml",
	RecordElement: "record",
	RowCount:      2,
	Indent:        true,
	Fields: []Field{
		{Name: "first_name", Function: "firstname"},
		{Name: "last_name", Function: "lastname"},
		{Name: "password", Function: "password", Params: MapParams{"special": {"false"}}},
	},
})
if err != nil {
	fmt.Println(err)
}

fmt.Println(string(value))
Output:

<xml>
    <first_name>Markus</first_name>
    <last_name>Moen</last_name>
    <password>856Y5wPZevX9</password>
</xml>

func (*Faker) Year

func (f *Faker) Year() int

Year will generate a random year between 1900 - current year

Example
f := New(11)
fmt.Println(f.Year())
Output:

1915

func (*Faker) Zip

func (f *Faker) Zip() string

Zip will generate a random Zip code string

Example
f := New(11)
fmt.Println(f.Zip())
Output:

13645

type Field

type Field struct {
	Name     string    `json:"name"`
	Function string    `json:"function"`
	Params   MapParams `json:"params"`
}

Field is used for defining what name and function you to generate for file outuputs

type FixedWidthOptions added in v6.25.0

type FixedWidthOptions struct {
	RowCount int     `json:"row_count" xml:"row_count" fake:"{number:1,10}"`
	Fields   []Field `json:"fields" xml:"fields" fake:"{fields}"`
}

FixedWidthOptions defines values needed for csv generation

type Info

type Info struct {
	Display     string                                                    `json:"display"`
	Category    string                                                    `json:"category"`
	Description string                                                    `json:"description"`
	Example     string                                                    `json:"example"`
	Output      string                                                    `json:"output"`
	ContentType string                                                    `json:"content_type"`
	Params      []Param                                                   `json:"params"`
	Any         any                                                       `json:"any"`
	Generate    func(r *rand.Rand, m *MapParams, info *Info) (any, error) `json:"-"`
}

Info structures fields to better break down what each one generates

func GetFuncLookup

func GetFuncLookup(functionName string) *Info

GetFuncLookup will lookup

func GetRandomSimpleFunc added in v6.25.0

func GetRandomSimpleFunc(r *rand.Rand) (string, Info)

func (*Info) GetAny added in v6.25.0

func (i *Info) GetAny(m *MapParams, field string) (any, error)

GetAny will retrieve Any field from Info

func (*Info) GetBool

func (i *Info) GetBool(m *MapParams, field string) (bool, error)

GetBool will retrieve boolean field from data

func (*Info) GetField

func (i *Info) GetField(m *MapParams, field string) (*Param, []string, error)

GetField will retrieve field from data

func (*Info) GetFloat32

func (i *Info) GetFloat32(m *MapParams, field string) (float32, error)

GetFloat32 will retrieve int field from data

func (*Info) GetFloat32Array added in v6.1.0

func (i *Info) GetFloat32Array(m *MapParams, field string) ([]float32, error)

GetFloat32Array will retrieve []float field from data

func (*Info) GetFloat64

func (i *Info) GetFloat64(m *MapParams, field string) (float64, error)

GetFloat64 will retrieve int field from data

func (*Info) GetInt

func (i *Info) GetInt(m *MapParams, field string) (int, error)

GetInt will retrieve int field from data

func (*Info) GetIntArray

func (i *Info) GetIntArray(m *MapParams, field string) ([]int, error)

GetIntArray will retrieve []int field from data

func (*Info) GetMap added in v6.25.0

func (i *Info) GetMap(m *MapParams, field string) (map[string]any, error)

GetMap will retrieve map[string]any field from data

func (*Info) GetString

func (i *Info) GetString(m *MapParams, field string) (string, error)

GetString will retrieve string field from data

func (*Info) GetStringArray

func (i *Info) GetStringArray(m *MapParams, field string) ([]string, error)

GetStringArray will retrieve []string field from data

func (*Info) GetUint

func (i *Info) GetUint(m *MapParams, field string) (uint, error)

GetUint will retrieve uint field from data

func (*Info) GetUintArray added in v6.14.0

func (i *Info) GetUintArray(m *MapParams, field string) ([]uint, error)

GetUintArray will retrieve []uint field from data

type JSONOptions

type JSONOptions struct {
	Type     string  `json:"type" xml:"type" fake:"{randomstring:[array,object]}"` // array or object
	RowCount int     `json:"row_count" xml:"row_count" fake:"{number:1,10}"`
	Indent   bool    `json:"indent" xml:"indent"`
	Fields   []Field `json:"fields" xml:"fields" fake:"{fields}"`
}

JSONOptions defines values needed for json generation

type JobInfo

type JobInfo struct {
	Company    string `json:"company" xml:"company"`
	Title      string `json:"title" xml:"title"`
	Descriptor string `json:"descriptor" xml:"descriptor"`
	Level      string `json:"level" xml:"level"`
}

JobInfo is a struct of job information

func Job

func Job() *JobInfo

Job will generate a struct with random job information

Example
Seed(11)
jobInfo := Job()
fmt.Println(jobInfo.Company)
fmt.Println(jobInfo.Title)
fmt.Println(jobInfo.Descriptor)
fmt.Println(jobInfo.Level)
Output:

ClearHealthCosts
Agent
Future
Tactics

type MapParams

type MapParams map[string]MapParamsValue

MapParams is the values to pass into a lookup generate

func NewMapParams

func NewMapParams() *MapParams

NewMapParams will create a new MapParams

func (*MapParams) Add

func (m *MapParams) Add(field string, value string)

Add will take in a field and value and add it to the map params type

func (*MapParams) Get added in v6.12.0

func (m *MapParams) Get(field string) []string

Get will return the array of string from the provided field

func (*MapParams) Size added in v6.8.0

func (m *MapParams) Size() int

Size will return the total size of the underlying map

type MapParamsValue added in v6.12.0

type MapParamsValue []string

func (*MapParamsValue) UnmarshalJSON added in v6.12.0

func (m *MapParamsValue) UnmarshalJSON(data []byte) error

UnmarshalJSON will unmarshal the json into the []string

type MarkdownOptions added in v6.25.0

type MarkdownOptions struct {
}

MarkdownOptions defines values needed for markdown document generation

type MovieInfo added in v6.22.0

type MovieInfo struct {
	Name  string `json:"name" xml:"name"`
	Genre string `json:"genre" xml:"genre"`
}

func Movie added in v6.22.0

func Movie() *MovieInfo
Example
Seed(11)
movie := Movie()
fmt.Println(movie.Name)
fmt.Println(movie.Genre)
Output:

Psycho
Mystery

type Param

type Param struct {
	Field       string   `json:"field"`
	Display     string   `json:"display"`
	Type        string   `json:"type"`
	Optional    bool     `json:"optional"`
	Default     string   `json:"default"`
	Options     []string `json:"options"`
	Description string   `json:"description"`
}

Param is a breakdown of param requirements and type definition

type PersonInfo

type PersonInfo struct {
	FirstName  string          `json:"first_name" xml:"first_name"`
	LastName   string          `json:"last_name" xml:"last_name"`
	Gender     string          `json:"gender" xml:"gender"`
	SSN        string          `json:"ssn" xml:"ssn"`
	Image      string          `json:"image" xml:"image"`
	Hobby      string          `json:"hobby" xml:"hobby"`
	Job        *JobInfo        `json:"job" xml:"job"`
	Address    *AddressInfo    `json:"address" xml:"address"`
	Contact    *ContactInfo    `json:"contact" xml:"contact"`
	CreditCard *CreditCardInfo `json:"credit_card" xml:"credit_card"`
}

PersonInfo is a struct of person information

func Person

func Person() *PersonInfo

Person will generate a struct with person information

Example
Seed(11)
person := Person()
job := person.Job
address := person.Address
contact := person.Contact
creditCard := person.CreditCard

fmt.Println(person.FirstName)
fmt.Println(person.LastName)
fmt.Println(person.Gender)
fmt.Println(person.SSN)
fmt.Println(person.Image)
fmt.Println(person.Hobby)

fmt.Println(job.Company)
fmt.Println(job.Title)
fmt.Println(job.Descriptor)
fmt.Println(job.Level)

fmt.Println(address.Address)
fmt.Println(address.Street)
fmt.Println(address.City)
fmt.Println(address.State)
fmt.Println(address.Zip)
fmt.Println(address.Country)
fmt.Println(address.Latitude)
fmt.Println(address.Longitude)

fmt.Println(contact.Phone)
fmt.Println(contact.Email)

fmt.Println(creditCard.Type)
fmt.Println(creditCard.Number)
fmt.Println(creditCard.Exp)
fmt.Println(creditCard.Cvv)
Output:

Markus
Moen
male
275413589
https://picsum.photos/208/500
Lacrosse
Intermap Technologies
Developer
Direct
Paradigm
369 North Cornerbury, Miami, North Dakota 24259
369 North Cornerbury
Miami
North Dakota
24259
Ghana
-6.662595
23.921575
3023202027
lamarkoelpin@heaney.biz
Maestro
39800889982276
01/30
932

type ProductInfo added in v6.26.0

type ProductInfo struct {
	Name        string   `json:"name" xml:"name"`
	Description string   `json:"description" xml:"description"`
	Categories  []string `json:"categories" xml:"categories"`
	Price       float64  `json:"price" xml:"price"`
	Features    []string `json:"features" xml:"features"`
	Color       string   `json:"color" xml:"color"`
	Material    string   `json:"material" xml:"material"`
	UPC         string   `json:"upc" xml:"upc"`
}

func Product added in v6.26.0

func Product() *ProductInfo

Product will generate a random set of product information

Example
Seed(11)
product := Product()
fmt.Println(product.Name)
fmt.Println(product.Description)
fmt.Println(product.Categories)
fmt.Println(product.Price)
fmt.Println(product.Features)
fmt.Println(product.Color)
fmt.Println(product.Material)
fmt.Println(product.UPC)
Output:

Olive Copper Monitor
Choir computer still far unless army party riches theirs instead here. Whichever that those instance growth has ouch enough Swiss us since down he. Aha us you to upon how this this furniture way no play towel.
[clothing tools and hardware]
41.61
[ultra-lightweight]
olive
stainless
074937734366

type SQLOptions added in v6.16.0

type SQLOptions struct {
	Table  string  `json:"table" xml:"table"`   // Table name we are inserting into
	Count  int     `json:"count" xml:"count"`   // How many entries (tuples) we're generating
	Fields []Field `json:"fields" xml:"fields"` // The fields to be generated
}

type SVGOptions added in v6.20.0

type SVGOptions struct {
	Height int
	Width  int
	Type   string
	Colors []string
}

type TemplateOptions added in v6.25.0

type TemplateOptions struct {
	Funcs template.FuncMap `fake:"-"`
	Data  any              `json:"data" xml:"data" fake:"-"`
}

TemplateOptions defines values needed for template document generation

type XMLOptions

type XMLOptions struct {
	Type          string  `json:"type" xml:"type" fake:"{randomstring:[array,single]}"` // single or array
	RootElement   string  `json:"root_element" xml:"root_element"`
	RecordElement string  `json:"record_element" xml:"record_element"`
	RowCount      int     `json:"row_count" xml:"row_count" fake:"{number:1,10}"`
	Indent        bool    `json:"indent" xml:"indent"`
	Fields        []Field `json:"fields" xml:"fields" fake:"{fields}"`
}

XMLOptions defines values needed for json generation

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL