Skip to content

Releases: brianvoe/gofakeit

v7.0.0 - math/rand/v2

18 Feb 02:12
Compare
Choose a tag to compare

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. 🌟

Descriptions!!!

20 Jan 01:00
Compare
Choose a tag to compare

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

What's Changed

Full Changelog: v6.27.0...v6.28.0

Products!!! v6.26.0

05 Dec 23:06
Compare
Choose a tag to compare

πŸš€ 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

Templates!!! v6.25.0

26 Nov 22:43
Compare
Choose a tag to compare

πŸš€ 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)

New Functions!!!

07 Jun 16:21
Compare
Choose a tag to compare

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

Added fakable interface

14 Apr 21:47
Compare
Choose a tag to compare

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

What's Changed

New Contributors

Full Changelog: v6.20.2...v6.21.0