Skip to content
This repository was archived by the owner on Jul 22, 2026. It is now read-only.

v1.4.0 — Precision & Power

Choose a tag to compare

@GraHms GraHms released this 03 Apr 17:09
· 12 commits to main since this release
4cb7d9e

📦 godantic v1.4.0 — Precision & Power

Release Date: 2025-04-03
Author: Ismael GraHms
Tag: v1.4.0


🚀 Highlights

This release introduces advanced numeric and decimal validation, enabling more expressive constraints directly via struct tags. It marks a major milestone in making godantic a robust, production-ready validation library — with native support for common real-world scenarios like monetary values, pagination limits, and constrained ranges.


✨ New Features

🔢 Generic Range Constraints

  • min and max for:
    • Strings (length)
    • Slices (length)
    • Numeric values

⚖️ Numeric Boundaries

  • gt / lt: Greater than / Less than
  • ge / le: Greater than or equal / Less than or equal

🎯 Multiples

  • multiple_of: Value must be a clean multiple of a given number (e.g., 0.05, 100)

🧮 Decimal Precision

  • max_digits: Maximum total digits (before + after decimal)
  • decimal_places: Maximum digits after decimal

☢️ Special Float Handling

  • allow_inf_nan: Accepts +Inf, -Inf, and NaN when explicitly enabled

🧪 Test Coverage

  • ✅ Full unit tests for all new validation rules
  • Edge case handling for:
    • Negative numbers
    • Floats with trailing/leading zeroes
    • Empty/nil fields
    • Boundary limits

📚 Documentation

  • Updated README with:
    • Full tag matrix
    • Code examples
    • Tag semantics and type compatibility