| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2025-06-01 | 3.1 kB | |
| v1.9.0 source code.tar.gz | 2025-06-01 | 23.2 kB | |
| v1.9.0 source code.zip | 2025-06-01 | 34.8 kB | |
| Totals: 3 Items | 61.1 kB | 0 | |
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
- build(deps): bump github/codeql-action from 3.28.17 to 3.28.18 by @dependabot in https://github.com/spf13/cast/pull/248
- build(deps): bump actions/dependency-review-action from 4.6.0 to 4.7.1 by @dependabot in https://github.com/spf13/cast/pull/247
- build(deps): bump actions/setup-go from 5.4.0 to 5.5.0 by @dependabot in https://github.com/spf13/cast/pull/245
- refactor: move number parsing to generic functions by @sagikazarmark in https://github.com/spf13/cast/pull/250
- Improve ToString/ToStringE performance by @ganigeorgiev in https://github.com/spf13/cast/pull/244
- Split caste.go into smaller files by @sagikazarmark in https://github.com/spf13/cast/pull/251
- refactor: remove unused initial int conversion by @sagikazarmark in https://github.com/spf13/cast/pull/253
- Generate code to make maintenance easier by @sagikazarmark in https://github.com/spf13/cast/pull/252
- feat: add To and ToNumber functions by @sagikazarmark in https://github.com/spf13/cast/pull/255
- build(deps): bump golangci/golangci-lint-action from 7.0.0 to 8.0.0 by @dependabot in https://github.com/spf13/cast/pull/243
- Move tests next to their implementation by @sagikazarmark in https://github.com/spf13/cast/pull/256
- Refactor number tests by @sagikazarmark in https://github.com/spf13/cast/pull/257
- feat: return 0 when casting an empty string to a number by @sagikazarmark in https://github.com/spf13/cast/pull/259
- Support converting string float numbers to integer types by @sagikazarmark in https://github.com/spf13/cast/pull/261
- Test improvements by @sagikazarmark in https://github.com/spf13/cast/pull/262
- Improvements by @sagikazarmark in https://github.com/spf13/cast/pull/263
- refactor: return indirection result from indirect function by @sagikazarmark in https://github.com/spf13/cast/pull/264
- Slice improvements by @sagikazarmark in https://github.com/spf13/cast/pull/265
- refactor: move error message to a constant by @sagikazarmark in https://github.com/spf13/cast/pull/267
- chore: improve map cast functions by @sagikazarmark in https://github.com/spf13/cast/pull/269
- Resolve aliases by @sagikazarmark in https://github.com/spf13/cast/pull/271
New Contributors
- @ganigeorgiev made their first contribution in https://github.com/spf13/cast/pull/244
Full Changelog: https://github.com/spf13/cast/compare/v1.8.0...v1.9.0