Gofakeit Versions Save

Random fake data generator written in go

v7.0.0

2 months ago

Gofakeit v7: What's New!

๐ŸŽฒ math/rand/v2 Integration

  • Better RNG ๐Ÿ”’: Now using math/rand/v2 for a more simplistic implementation and two new source types(pcg, chacha8).
  • Simplified faker ๐Ÿงน: Refined faker struct for ease of use, mirroring the simplicity improvements of math/rand/v2.

โœจ Highlights

  • New Sources : math/rand/v2 added PCG and ChaCha8. Gofakeit also added a sub package called source with additional sources in it.

Example New and NewFaker usage

import (
	"github.com/brianvoe/gofakeit/v7"
	"github.com/brianvoe/gofakeit/v7/source"
	"math/rand/v2"
)

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

// NewFaker takes in a source and whether or not it should be thread safe
faker := gofakeit.NewFaker(source rand.Source, threadSafe bool)

// PCG Pseudo
faker := gofakeit.NewFaker(rand.NewPCG(11, 11), true)

// ChaCha8
faker := gofakeit.NewFaker(rand.NewChaCha8([32]byte{0, 1, 2, 3, 4, 5}), true)


// Additional from Gofakeit sub package source

// JSF(Jenkins Small Fast)
faker := gofakeit.NewFaker(source.NewJSF(11), true)

// SFC(Simple Fast Counter)
faker := gofakeit.NewFaker(source.NewSFC(11), true)

// Crypto - Uses crypto/rand
faker := gofakeit.NewFaker(source.NewCrypto(), true)

// Dumb - simple incrementing number
faker := gofakeit.NewFaker(source.NewDumb(11), true)

๐Ÿ™ Acknowledgments

A huge shoutout to our contributors and users! Your feedback and support have been invaluable. ๐ŸŒŸ

v6.28.0

3 months ago

Thanks to the contributor @se-omar for all his great work in updating all the descriptions for lookups.

What's Changed

Full Changelog: https://github.com/brianvoe/gofakeit/compare/v6.27.0...v6.28.0

v6.26.0

5 months ago

๐Ÿš€ Unleash the Power of Gofakeit 2.0: Elevate Your Data Faking Game! ๐Ÿš€

We're thrilled to introduce the latest and greatest update to Gofakeit, and this time, we've supercharged your data faking experience with a suite of powerful new functions! Say hello to the game-changing Product module, a feature-packed addition that will revolutionize the way you generate fake product information. ๐Ÿ›๏ธโœจ

๐ŸŽ Introducing the Product() Function: Get ready to dive into a world of limitless possibilities with the Product() function! It's your go-to command for creating realistic and captivating fake product data effortlessly. Harness the magic within this function to craft dynamic, authentic product information that will leave your users amazed and engaged.

๐Ÿท๏ธ ProductName() โ€“ Unleash the Creativity: Forge compelling product identities with the ProductName() function. From quirky gadgets to sophisticated fashion pieces, this function lets you generate catchy and unique names that captivate your audience.

๐Ÿ“ ProductDescription() โ€“ Tell a Story: Bring your products to life with the ProductDescription() function! Craft vivid and intriguing descriptions that go beyond the mundane, ensuring your fake data is as immersive as it is imaginative. Spark curiosity and keep your users hooked.

๐Ÿ”– ProductCategory() โ€“ Define the Essence: Organize your products seamlessly with the ProductCategory() function. From electronics to fashion, create a diverse range of categories that add depth and structure to your fake data, making it more realistic and relatable.

๐ŸŒŸ ProductFeature() โ€“ Highlight the Best: Elevate your product data with the ProductFeature() function! Showcase unique features that set your fake products apart. Whether it's cutting-edge technology or innovative design, this function lets you highlight the essence of your creations.

๐Ÿ› ๏ธ ProductMaterial() โ€“ Craft Authenticity: Immerse your users in the tactile world of your fake products with the ProductMaterial() function. Specify materials that resonate with authenticity, allowing your users to envision the quality and feel of the items you've meticulously crafted.

๐ŸŽ‰ Elevate your data generation game to new heights with Gofakeit 2.0! ๐ŸŽ‰ Unleash creativity, captivate your audience, and make your fake data more convincing than ever before. The world is your oyster, and with Gofakeit's new Product module, you're the master creator of captivating, realistic product information! ๐Ÿš€๐ŸŒ๐Ÿ’ผ

Upgrade now and experience the thrill of data faking like never before! ๐Ÿš€โœจ #Gofakeit

v6.25.0

5 months ago

๐Ÿš€ Exciting New Release for Gofakeit v6!

We're thrilled to introduce the latest version of Gofakeit, packed with a powerful addition to enhance your templating experience. Brace yourself for the introduction of custom outputs using Golang's template engine! ๐ŸŒŸ

SPECIAL THANKS to @Mrpye for his work on this!

๐ŸŽญ Template Magic Now, you can unleash your creativity with custom outputs using Golang's template engine. We've integrated all available functions into the template engine, providing you with a versatile toolkit to craft dynamic and personalized content.

๐Ÿ›  Additional Functions But that's not all! We've gone the extra mile and added some game-changing functions to supercharge your template building:

ToUpper & ToLower: Easily manipulate text case for a polished appearance. ToString: Swiftly convert any data type to a string. ToDate: Effortlessly transform strings into time.Time objects. SpliceAny, SpliceString, SpliceUInt, SpliceInt: Build slices dynamically, perfect for weighted scenarios and random selections.

๐ŸŒ Example Usages To give you a taste of the excitement, here's a snippet showcasing the newfound template capabilities:

// Your template goes here
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}}
`

// Applying the template
value, err := gofakeit.Template(template, nil)

v6.22.0

11 months ago

Thanks to the help of @ViridianForge and @dminkovski! We now have Books, Movies, Middle Names, Blurbs and Company Slogans.

v6.21.0

1 year ago

See https://github.com/brianvoe/gofakeit#fakeable-types

What's Changed

New Contributors

Full Changelog: https://github.com/brianvoe/gofakeit/compare/v6.20.2...v6.21.0