Skip to content

Releases: spf13/cast

v1.10.0

08 Sep 16:46
v1.10.0
fc73346

Choose a tag to compare

What's Changed

  • build(deps): bump ossf/scorecard-action from 2.4.1 to 2.4.2 by @dependabot[bot] in #275
  • build(deps): bump github/codeql-action from 3.28.18 to 3.28.19 by @dependabot[bot] in #277
  • build(deps): bump github/codeql-action from 3.28.19 to 3.29.5 by @dependabot[bot] in #289
  • build(deps): bump github/codeql-action from 3.29.7 to 3.29.10 by @dependabot[bot] in #296
  • build(deps): bump actions/dependency-review-action from 4.7.1 to 4.7.2 by @dependabot[bot] in #295
  • build(deps): bump actions/checkout from 4.2.2 to 5.0.0 by @dependabot[bot] in #293
  • build(deps): bump github/codeql-action from 3.29.10 to 3.30.1 by @dependabot[bot] in #301
  • build(deps): bump actions/setup-go from 5.5.0 to 6.0.0 by @dependabot[bot] in #300
  • build(deps): bump actions/dependency-review-action from 4.7.2 to 4.7.3 by @dependabot[bot] in #298
  • Always return empty map instead of nil when conversion fails by @andig in #283

New Contributors

Full Changelog: v1.9.2...v1.10.0

v1.9.2

02 Jun 13:38
v1.9.2
40e8e07

Choose a tag to compare

What's Changed

Full Changelog: v1.9.1...v1.9.2

v1.9.1

01 Jun 15:01
v1.9.1
cb5df5f

Choose a tag to compare

What's Changed

Full Changelog: v1.9.0...v1.9.1

v1.9.0

01 Jun 11:34
v1.9.0
a79ffed

Choose a tag to compare

Notable new features 🎉

  • Casting from type aliases is now supported for basic types
  • Added generic functions: To/ToE, Must, ToNumber/ToNumberE
  • Increased test coverage
  • Converting float numbers from string is now supported

Warning

Since cast now supports converting float values from strings, a related edge case behaves differently:

In previous versions, attempting to convert an empty string to a float resulted in an error.

Starting with this version, the same operation no longer raises an error.

To maintain consistency with the rest of the library, an empty string now converts to the float value 0.0.

What's Changed

New Contributors

Full Changelog: v1.8.0...v1.9.0

v1.8.0

02 May 12:18
v1.8.0
01004f2

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.7.1...v1.8.0

v1.7.1

18 Dec 10:10
@bep bep
487df00

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.7.0...v1.7.1

v1.7.0

06 Aug 19:13
@bep bep

Choose a tag to compare

What's Changed

Full Changelog: v1.6.0...v1.7.0

v1.6.0

28 Nov 09:54
@bep bep

Choose a tag to compare

What's Changed

Full Changelog: v1.5.1...v1.6.0

v1.5.1

15 May 08:31
@bep bep

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.5.0...v1.5.1

v1.5.0: Misc number fixes

11 May 13:59
@bep bep

Choose a tag to compare

  • Add support for json.Number
  • Enable integer and float conversion of time.Weekday and time.Month values
  • Allow nil in ToFloat* (which gets it in line with the rest)
  • Trim trailing zero decimals from string numbers, e.g. 10.0 before any int parsing.
  • Remove some test duplication
  • Replace testify with quicktest