Major updates, most of them got from gofakeit v4:
- new: Languages (2 letter codes and long names)
- new: Programming Languages
- new: MacAddress
- new: Map with empty interface, with random 4 types
- new: Hexify replaces specific placeholder with Hex ASCII characters
- new: Question and Quote (sentence variations)
- fixed and improved: HexColor
- fixed timed based tests (current year)
- removed Numerify first digit to be non-zero limit
- new methods: SHA256 and MD5
Improves TemplateCustom/Template performance, reduces the memory allocations by ~25% by reusing internal structures (object pooling).
Fixes templates Regex cache parallel writes panic
Adds a more complex example: Analytics
Brand new template system. Unlike the old Generate() and Struct() methods that were limited to the /data and basic types, templates allows custom patterns to call all the Faker methods.
The method Generate() was removed and replaced with Template(), acts in the same way, but with different variables. For more details see the Templates readme
Other changes:
- modified all benchmarks to use the FastFaker (instead of Safe)
- new method: Binary ("0" or "1")
- new method: BoolText ("false" or "true")
- new examples, benchmarks and tests
- removed Generate method
- Struct and HackerPhrase now use Template* methods
Optimizations
Sentence generator improved with 95% less memory allocations and 50% faster (CPU), affects:
- Sentence, SentenceAvg
- Paragraph, ParagraphAvg
- HipsterSentence, HipsterSentenceAvg
- HipsterParagraph, HipsterParagraphAvg
More tests and /data functionality.
Optimizations and big bug fix.
Fixes digit 9 missing from randDigit, callers affected:
- Street and StreetNumber
- HexColor
- Phone and PhoneFormatted and Person
- Username
- Numerify
- CreditCard and Digit
Optimized URL() memory allocations (~20%) Updated benchmarks Simplified randDigit Fixed travis
Breaking changes (import path): moved all the root *go files into a new package: /faker
More tests and examples. Replace the image generator (the website was too slow) with http://pipsum.com
Adds basic function ()string alternatives to the ones that have parameters (like ImageURL, Sentence and Password).
- Adds AvatarURL() function
- Adds PasswordFull() function
- Adds DateCurrentYear
- Adds DateCurrentYearStr
- Adds DateStr
- Adds SentenceAvg and HipsterSentenceAvg
- Adds ParagraphAvg and HipsterParagraphAvg
Moved /data package logic from the faker.
Extracted the pseudo-random main functions to its on package /randomizer.
No breaking changes.
Start from the gofakeit 3.14 version:
- changed the name to FastFaker, updated all files
Huge refactor with breaking changes:
- moved all public functions to methods to a new struct (Faker)
- added 2 working modes: Safe or Fast
- new tests, benchmarks and examples
- small updates