Skip to content

chore: upgrade ecp to v0.3.0 - #4

Merged
wrfly merged 1 commit into
masterfrom
chore/upgrade-ecp-0.3.0
Aug 19, 2026
Merged

wrfly merged 1 commit into
masterfrom
chore/upgrade-ecp-0.3.0

Conversation

@wrfly

@wrfly wrfly commented Aug 19, 2026 •

Copy link
Copy Markdown
Owner

Bumps ecp from v0.2.3 to v0.3.0.

No source change needed

The hooks this package installs — BuildKey and LookupValue — keep their names and signatures, so the upgrade is a go.mod bump.

What it fixes for gua

All of these are reachable from a flag value:

  • two panics — a named-type slice ([]Level) and a pointer to a named type (*time.Duration)
  • 1e1000000-style numbers — an unbounded exponent expansion that spent ~100s building a 1MB string before failing
  • name:"-" — a - tag was still bound to a real key

Verification

example/ prints byte-for-byte identical output before and after, across all eight scenarios: no flags; the full flag set (-nnnnname -age -extra.loc -extra.debug -sliceint -time -type); -h usage; -extra.valid=false (bool default:"true" turned off); -nnnnname "" (empty flag value); -slice "a b c"; -time 3d; -age 1e3.

Tests

TestGua only asserted that parsing does not return an error — an upgrade could have broken every parsed value without failing it. Added:

  • TestParseFlags — parses a real flag set and asserts the results, including a default:"true" bool turned off from the command line, a string slice, a 3d duration and a nested key
  • TestParseDefaults — defaults survive when no flag is given

Compatibility

gua's own API is unchanged. go.mod moves to go 1.19, the version ecp requires — the only thing consumers need to care about.

🤖 Generated with Claude Code

No source change is needed: the hooks this package installs, BuildKey and
LookupValue, keep their names and signatures.

The release fixes two panics reachable from a flag value, a named type
slice ([]Level) and a pointer to a named type (*time.Duration), an
unbounded exponent expansion that could hang startup for minutes on a
value like 1e1000000, and a `-` tag being bound to a real key.

Behaviour is unchanged. The example prints byte-for-byte the same output
across no flags, a full set of flags, -h, an empty flag value, a bool
default turned off, a `3d` duration and a `1e3` number.

Tests: TestGua only checked that parsing does not fail, so an upgrade
could break every parsed value without failing it. Added TestParseFlags,
which parses a real flag set and asserts the results, and
TestParseDefaults.

go.mod moves to go 1.19, the version ecp requires.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@wrfly
wrfly force-pushed the chore/upgrade-ecp-0.3.0 branch from 227256b to 1676595 Compare August 19, 2026 16:04
@wrfly
wrfly merged commit 73526de into master Aug 19, 2026
@wrfly
wrfly deleted the chore/upgrade-ecp-0.3.0 branch August 19, 2026 16:04
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