Repository navigation
Rewrite README and fix -output help text - #126
Merged
Merged
Conversation
Restructure the README around a quick-start example and flag reference tables, and verify every claim against the source and golden files. Fixes in the README: - IsAPill example had inverted logic - MarshalJSON example ignored the error return value - help dump was missing -flag.value and -pflag.value - default output file is <type>_enumer.go, not <type>_string.go - document transform underscore aliases, title/title-lower behavior, trim/transform/addprefix ordering, Scan input types and nil handling, and that -typederrors adds a runtime dependency on enumerrs - add go get -tool / go tool install path Also correct the -output flag help text, which named the wrong default.
This was referenced Oct 3, 2026
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.
Summary
The README had grown by accretion and carried several errors. This rewrites it around a quick-start example and flag reference tables, with every claim checked against the source, the golden files, and a live run of v1.6.4 in a scratch module.
README fixes
IsAPill()example had inverted logic (printed "is not a value" when the check was true)Aspirin.MarshalJSON()example ignored the error return value--helpdump was stale and missing-flag.valueand-pflag.value<type>_enumer.golowercased, not<type>_string.gosnake_upper, etc.)titleandtitle-loweractually do (first letter only)Scanaccepted input types andnilhandling-typederrorsmakesenumera runtime dependency viaenumerrsgo get -tool/go tool enumerinstall pathCode change
The
-outputflag help text said the default wassrcdir/<type>_string.go. The actual default issrcdir/<type>_enumer.go. Help text corrected to match.Verification
go vet ./...cleango test ./...passes-linecomment,-transform=title-lower, and-typederrorsexamples run in a fresh module and output matched the README