Skip to content

Releases: dahaiyiyimcom/money

v1.0.1

11 Feb 12:57

Choose a tag to compare

money v1.0.1 — Safe deterministic money type for Go

This release provides a production-ready money type for Go services with deterministic, integer-based arithmetic and safe transport/DB integration.

✨ Features

  • Minor-unit (int64) based money model — no float rounding errors
  • MySQL DECIMAL(10,2) scan/write support
  • JSON transport as string ("12.34") for HTTP & Kafka safety
  • Deterministic rounding modes (HalfUp / Floor / Ceil)
  • Proportional allocation with exact-sum guarantee
  • Immutable value type (goroutine-safe)
  • Zero external dependencies

🧪 Reliability

  • Unit tests + property tests
  • Fuzz testing for ParseString
  • Benchmark coverage for core operations
  • High statement coverage

🐛 Fixes

  • Prevent overflow in ParseString for extremely large numeric inputs
  • Added overflow guards to keep minor-unit conversion safe
  • Fuzz-discovered edge cases are now covered by regression corpus

🔒 Guarantees

  • No float arithmetic in calculations
  • Exact minor-unit math
  • Deterministic results across services
  • Safe DB ↔ domain ↔ JSON conversion
  • Stable v1 API (no breaking changes)

⚠️ Breaking Changes

None.

📦 Install

go get github.com/dahaiyiyimcom/money@v1.0.1

v1.0.0

11 Feb 07:20

Choose a tag to compare

Initial stable release