Conversation
- Add codebase improvement spec docs.
- Support custom dictionary. - Various code cleanup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fixes, library improvements, and word list quality
Bug fixes
pflag.Lookup("seed").Changedto distinguish an explicit seed from an absent one, making all int64 values valid seeds.WithSizereturns(GeneratorOption, error)instead of a silent no-op option. Invalid sizes fail at construction time rather than surfacing as an error on the firstGenerate()call.New features
--format / -fflag — CLI now supports--format jsonto emit all names as a JSON array (["name1","name2"]), useful for scripting. Default behavior is unchanged (plain).WithDictionaryandNewCustomDictionary— Library callers can now supply custom word lists.NewCustomDictionary(adjectives, adverbs, nouns, verbs []string)builds a Dictionary with per-category overrides; nil slices fall back to the embedded defaults. Fulfills a long-standing TODO.--quantityvalidation — Passing--quantity 0or a negative value now exits with a clear error instead of silently producing no output.Library API
ParseCasingadded — ReplacesCasingFromStringas the canonical name (idiomatic Go convention for string parsing).CasingFromStringis kept as a deprecated alias.Performance
split()in dictionary.go replacedbufio.Scanneron in-memory strings withstrings.Split— simpler and avoids unnecessary reader allocation.applyCasingreplaces amap[Casing]funclookup with a switch — zero allocation, no hash overhead.Word list quality
CI