Skip to content

Rewrite README and fix -output help text - #126

Merged
dmarkham merged 1 commit into
masterfrom
readme-cleanup
Oct 3, 2026
Merged

dmarkham merged 1 commit into
masterfrom
readme-cleanup

Conversation

@dmarkham

@dmarkham dmarkham commented Oct 3, 2026

Copy link
Copy Markdown
Owner

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
  • --help dump was stale and missing -flag.value and -pflag.value
  • Default output file is <type>_enumer.go lowercased, not <type>_string.go
  • Documented the underscore aliases for transforms (snake_upper, etc.)
  • Explained what title and title-lower actually do (first letter only)
  • Trim, transform, and addprefix order is now a numbered list matching the code
  • Documented Scan accepted input types and nil handling
  • Noted that -typederrors makes enumer a runtime dependency via enumerrs
  • Added the Go 1.24 go get -tool / go tool enumer install path

Code change

The -output flag help text said the default was srcdir/<type>_string.go. The actual default is srcdir/<type>_enumer.go. Help text corrected to match.

Verification

  • go vet ./... clean
  • go test ./... passes
  • Quick-start, -linecomment, -transform=title-lower, and -typederrors examples run in a fresh module and output matched the README

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.
@dmarkham
dmarkham merged commit 97e8854 into master Oct 3, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant