Releases: spf13/cast
Releases ยท spf13/cast
8000
v1.9.2
What's Changed
- fix: float string to number parsing by @sagikazarmark in #276
Full Changelog: v1.9.1...v1.9.2
v1.9.1
What's Changed
- fix: indirection of typed nils by @sagikazarmark in #273
Full Changelog: v1.9.0...v1.9.1
v1.9.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 #248
- build(deps): bump actions/dependency-review-action from 4.6.0 to 4.7.1 by @dependabot in #247
- build(deps): bump actions/setup-go from 5.4.0 to 5.5.0 by @dependabot in #245
- refactor: move number parsing to generic functions by @sagikazarmark in #250
- Improve ToString/ToStringE performance by @ganigeorgiev in #244
- Split caste.go into smaller files by @sagikazarmark in #251
- refactor: remove unused initial int conversion by @sagikazarmark in #253
- Generate code to make maintenance easier by @sagikazarmark in #252
- feat: add To and ToNumber functions by @sagikazarmark in #255
- build(deps): bump golangci/golangci-lint-action from 7.0.0 to 8.0.0 by @dependabot in #243
- Move tests next to their implementation by @sagikazarmark in #256
- Refactor number tests by @sagikazarmark in #257
- feat: return 0 when casting an empty string to a number by @sagikazarmark in #259
- Support converting string float numbers to integer types by @sagikazarmark in #261
- Test improvements by @sagikazarmark in #262
- Improvements by @sagikazarmark in #263
- refactor: return indirection result from indirect function by @sagikazarmark in #264
- Slice improvements by @sagikazarmark in #265
- refactor: move error message to a constant by @sagikazarmark in #267
- chore: improve map cast functions by @sagikazarmark in #269
- Resolve aliases by @sagikazarmark in #271
New Contributors
- @ganigeorgiev made their first contribution in #244
Full Changelog: v1.8.0...v1.9.0
v1.8.0
What's Changed
- Updates by @sagikazarmark in #237
- Bump actions/setup-go from 4.0.1 to 4.1.0 by @dependabot in #193
- Generic by @sagikazarmark in #238
- Add unsigned integer support in ToStringSliceE function by @nicklaus-dev in #200
- Add function to cast
interface{}
to[]float64
by @ste93cry in #179 - Add cast methods ToUintSlice by @nmvalera in #236
- build(deps): bump actions/dependency-review-action from 4.5.0 to 4.6.0 by @dependabot in #240
- build(deps): bump github/codeql-action from 2.13.4 to 3.28.15 by @dependabot in #239
- build(deps): bump github/codeql-action from 3.28.15 to 3.28.17 by @dependabot in #242
- Add ToInt64Slice() and ToInt64SliceE() by @arui1628 in #234
New Contributors
- @nicklaus-dev made their first contribution in #200
- @ste93cry made their first contribution in #179
- @nmvalera made their first contribution in #236
- @arui1628 made their first contribution in #234
Full Changelog: v1.7.1...v1.8.0
v1.7.1
What's Changed
- Update README.md by @lesichkovm in #224
- Fix ToUint64 issue with string input exceeding maximum int64 by @skyjerry in #213
New Contributors
- @lesichkovm made their first contribution in #224
- @skyjerry made their first contribution in #213
Full Changelog: v1.7.0...v1.7.1
v1.7.0
v1.6.0
What's Changed
- Bump actions/setup-go from 3 to 4 by @dependabot in #180
- Bump github.com/frankban/quicktest from 1.14.4 to 1.14.5 by @dependabot in #185
- Updates by @sagikazarmark in #190
- deps/update20231128 by @bep in #205
Full Changelog: v1.5.1...v1.6.0
v1.5.1
What's Changed
- Correction of hugo URL error by @qwxingzhe in #164
- Improve CI by @sagikazarmark in #167
- Bump github.com/frankban/quicktest from 1.14.3 to 1.14.4 by @dependabot in #168
- Add more integer to boolean conversions by @yveshield in #153
- Pull the 2006-01-02 layout to the top when checking by @bep in #187
New Contributors
- @qwxingzhe made their first contribution in #164
- @sagikazarmark made their first contribution in #167
- @dependabot made their first contribution in #168
- @yveshield made their first contribution in #153
Full Changelog: v1.5.0...v1.5.1
v1.5.0: Misc number fixes
- Add support for
json.Number
- Enable integer and float conversion of
time.Weekday
andtime.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