Repository navigation
v1.0.2 - Complete Lint Cleanup
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 inInteger,Number, andPercentagetypes- Renamed parameters:
min/maxβminValue/maxValue
- Renamed parameters:
- Fixed G601 implicit memory aliasing in test loop (added proper variable capture)
- Renamed
Integer.Min()/Max()toMinimum()/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/MaximumAll other APIs remain unchanged.
Full Changelog: v1.0.1...v1.0.2