Releases: brianvoe/gofakeit
v7.0.0 - math/rand/v2
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
π§Ή: Refinedfaker
struct for ease of use, mirroring the simplicity improvements ofmath/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!!!
Thanks to the contributor @se-omar for all his great work in updating all the descriptions for lookups.
What's Changed
- Sql descs by @se-omar in #323
- School descs by @se-omar in #322
- Product descs by @se-omar in #321
- Person descs by @se-omar in #320
- Payment descs by @se-omar in #319
- Number descs by @se-omar in #318
- improve word adjective by @se-omar in #327
- improve time descs by @se-omar in #326
- improve template descs by @se-omar in #325
- improve string descs by @se-omar in #324
- improve word grammer descs by @se-omar in #331
- improve word general descs by @se-omar in #330
- improve word connective by @se-omar in #329
- improve word adverbs by @se-omar in #328
- improve app descs by @se-omar in #339
- improve word_noun descs by @se-omar in #333
- improve word phrase descs by @se-omar in #334
- improve preposition descs by @se-omar in #335
- improve word verb descs by @se-omar in #338
- improve word sentence descs by @se-omar in #337
- improve pronoun descs by @se-omar in #336
- improve car descs by @se-omar in #343
- improve book descs by @se-omar in #342
- improve beer descs by @se-omar in #341
- improve auth descs by @se-omar in #340
Full Changelog: v6.27.0...v6.28.0
Products!!! v6.26.0
π 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
π 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!!!
Thanks to the help of @ViridianForge and @dminkovski! We now have Books, Movies, Middle Names, Blurbs and Company Slogans.
Added fakable interface
See https://github.com/brianvoe/gofakeit#fakeable-types
What's Changed
- JSON/XML/CSV nil options by @mgilbir in #231
- Custom fakeable types by @mgilbir in #230
- Safe json.RawMessage and json.Number by @mgilbir in #233
- Random generation of CUSIPs, PPNs, and ISINs by @ViridianForge in #234
New Contributors
- @mgilbir made their first contribution in #231
- @ViridianForge made their first contribution in #234
Full Changelog: v6.20.2...v6.21.0