Skip to content

v0.2.5

Choose a tag to compare

@wrfly wrfly released this 15 Aug 19:13
· 4 commits to master since this release
d14d831

Bug-fix release (PR #23): edge-case values that previously produced silent wrong values, errors, or panics.

Fixes

  • int fields no longer accept duration syntax (e.g. 10s used to silently set the value to 1e10 nanoseconds); only time.Duration fields are parsed as durations
  • int/uint/float fields and pointers are parsed with their bit size, so out-of-range values error out instead of being silently truncated (e.g. int8 field with 1000 used to become -24)
  • []int64 with duration-like values and []time.Duration with plain numbers no longer panic in reflect.Value.Set
  • *[]T pointer-to-slice fields now parse correctly (previously failed with "field is not addressable")
  • environment values now overwrite non-nil pointer fields, matching the documented behavior
  • parseScientific rejects negative exponents (e.g. 1e-3 used to silently become 1) and handles comma+exponent combos like 1,000e3
  • Parse(&c) where c is already a pointer no longer panics; nil or non-struct configs return an error instead of panicking, List returns an empty list

Tests

  • All existing tests pass; 13 regression tests added in bugfix_test.go