Skip to content

v1.0.2 - Complete Lint Cleanup

Choose a tag to compare

@SCKelemen SCKelemen released this 17 Dec 08:09
· 13 commits to main since this release

units v1.0.2 - Complete Lint Cleanup 🐻

Patch release resolving all remaining golangci-lint issues and improving CI coverage.

πŸ”§ Fixed

golangci-lint Compliance

  • βœ… All golangci-lint errors resolved - Package now passes all linter checks
  • Fixed Clamp() parameter shadowing in Integer, Number, and Percentage types
    • Renamed parameters: min/max β†’ minValue/maxValue
  • Fixed G601 implicit memory aliasing in test loop (added proper variable capture)
  • Renamed Integer.Min()/Max() to Minimum()/Maximum() to avoid confusion with Go 1.21+ built-in functions

πŸš€ Changed

Enhanced CI Testing

  • Updated test matrix: Go 1.21, 1.23, and 1.25 (replaced 1.22 with 1.25)
  • All lint, vet, and build checks now use Go 1.25 (latest development version)
  • Ensures compatibility with both stable and cutting-edge Go releases

⚠️ Breaking Changes

Only affects users of Integer type methods:

// Before (v1.0.1)
smaller := Int(10).Min(Int(5))
larger := Int(10).Max(Int(5))

// After (v1.0.2)
smaller := Int(10).Minimum(Int(5))
larger := Int(10).Maximum(Int(5))

Why: Avoids shadowing Go 1.21+ built-in min()/max() functions for better code clarity.

βœ… CI Status

All checks passing:

  • βœ“ Tests on Go 1.21, 1.23, 1.25
  • βœ“ golangci-lint clean
  • βœ“ 73.8% test coverage
  • βœ“ 177 tests passing
  • βœ“ Zero dependencies

πŸ“¦ Installation

go get github.com/SCKelemen/units@v1.0.2

πŸ”„ Migration from v1.0.1

Breaking: If you use Integer.Min() or Integer.Max():

# Find usages
grep -r "\.Min(" --include="*.go"
grep -r "\.Max(" --include="*.go"

# Replace with Minimum/Maximum

All other APIs remain unchanged.


Full Changelog: v1.0.1...v1.0.2