Skip to content

Releases: ccoVeille/go-safecast

v2.0.1

Choose a tag to compare

@ccoVeille ccoVeille released this 28 May 17:51

What's Changed

Fixes

Minor

  • build(deps): bump golangci/golangci-lint-action from 8 to 9 in the all group by @dependabot[bot] in #130
  • build(deps): bump the all group with 2 updates by @dependabot[bot] in #131
  • build(deps): bump actions/checkout from 5 to 6 in the all group by @dependabot[bot] in #132
  • build(deps): bump the all group across 1 directory with 3 updates by @dependabot[bot] in #134
  • build(deps): bump crate-ci/typos from 1.40.0 to 1.41.0 in the all group by @dependabot[bot] in #135
  • build(deps): bump the all group across 1 directory with 2 updates by @dependabot[bot] in #137
  • build(deps): bump crate-ci/typos from 1.42.3 to 1.43.3 in the all group by @dependabot[bot] in #138
  • build(deps): bump crate-ci/typos from 1.43.3 to 1.43.4 in the all group by @dependabot[bot] in #139
  • build(deps): bump crate-ci/typos from 1.43.4 to 1.44.0 in the all group by @dependabot[bot] in #140
  • build(deps): bump raven-actions/actionlint from 2.1.1 to 2.1.2 in the all group by @dependabot[bot] in #141
  • build(deps): bump the all group with 2 updates by @dependabot[bot] in #142
  • build(deps): bump crate-ci/typos from 1.44.0 to 1.45.0 in the all group by @dependabot[bot] in #143
  • build(deps): bump crate-ci/typos from 1.45.0 to 1.45.1 in the all group by @dependabot[bot] in #146
  • build(deps): bump the all group with 2 updates by @dependabot[bot] in #147
  • build(deps): bump the all group with 2 updates by @dependabot[bot] in #150
  • build(deps): bump crate-ci/typos from 1.46.2 to 1.46.3 in the all group by @dependabot[bot] in #151

New Contributors

Full Changelog: v2.0.0...v2.0.1

v2.0.0

Choose a tag to compare

@ccoVeille ccoVeille released this 03 Nov 22:08

What brings the v2 ?

Fixed

  • float overflow handling with parse float from string

    Previously, it returned an ErrStringConversion error while it's an overflow.
    Now it returns the proper overflow error.

BREAKING CHANGES

  • package no longer supports converting from bool

true/false are no longer converted to 1/0
These values cannot overflow, this was an error.

  • Convert no longer supports converting from string

You can now use Parse function

  • string to number conversion no longer uses base 0 (auto-detect in Go strconv library)

Use Parse function with proper base instead

This solves issue with 07 being parsed as 7, and 08 being reported as an invalid octal

  • Convert no longer returns 0 when conversion fails (e6c5137)

It now returns the invalid converted value with the error

  • Removed Input type (Input=string|bool|Number)

This type was used by Convert function to represent input value.
Now Convert function uses Number type directly.

This also drastically improves performance as it removes the type assertion checks.

All of these was introduced with #120

Minor

  • build(deps): bump crate-ci/typos from 1.38.1 to 1.39.0 in the all group by @dependabot[bot] in #127

Full Changelog: v1.8.1...v2.0.0

v1.8.2 deprecate the v1

Choose a tag to compare

@ccoVeille ccoVeille released this 03 Nov 22:14

What's Changed

v1 is now deprecated, please use v2

d47929d

Full Changelog: v1.8.1...v1.8.2

v1.8.1

Choose a tag to compare

@ccoVeille ccoVeille released this 31 Oct 00:32
28158aa

What's Changed

  • feat: use quotes when reporting issue with string conversion by @ccoVeille in #125

Minor

Full Changelog: v1.8.0...v1.8.1

v1.8.0

Choose a tag to compare

@ccoVeille ccoVeille released this 29 Oct 14:50

What's Changed

  • chore: add deprecation notice to all ToIntXX and ToUIntXX functions by @ccoVeille in #122

Full Changelog: v1.7.0...v1.8.0

v1.7.0

Choose a tag to compare

@ccoVeille ccoVeille released this 14 Oct 22:05

What's Changed

  • refactor: remove type assertions by @ccoVeille in #116
  • build(deps): bump crate-ci/typos from 1.36.2 to 1.36.3 in the all group by @dependabot[bot] in #115
  • fix: handle Go +/- math.Inf and NaN in conversions by @ccoVeille in #118
  • feat: add RequireConvert function by @ccoVeille in #106

Minor

Full Changelog: v1.6.1...v1.7.0

v1.6.1

Choose a tag to compare

@ccoVeille ccoVeille released this 21 Mar 17:56

This is a maintenance release.

Nothing was added to the API, @acquisitionist spotted an issue with the documentation and fixed it.
I then worked on activating some linters to detect such use cases.

What's Changed

New Contributors

Full Changelog: v1.6.0...v1.6.1

v1.6.0

Choose a tag to compare

@ccoVeille ccoVeille released this 12 Mar 16:37

Breaking Changes

  • feat: remove error and fmt.Stringer support by @ccoVeille in #77
  • chore: change the signature of the Convert and MustConvert by @ccoVeille in #78

What's Changed

  • ci: enforce the library has no dependencies except the standard library by @ccoVeille in #69
  • fix type alias issue by @ccoVeille in #81

Full Changelog: v1.5.0...v1.6.0

v1.5.0

Choose a tag to compare

@ccoVeille ccoVeille released this 18 Dec 00:40

What's Changed

Full Changelog: v1.4.0...v1.5.0

v1.4.0

v1.4.0 Pre-release
Pre-release

Choose a tag to compare

@ccoVeille ccoVeille released this 17 Dec 23:41

What's Changed

  • Add Convert and support conversion from string and boolean by @ccoVeille in #55
  • More errors were added.
  • 💥 Breaking changes: Remove Error struct that was exposed. It brought confusion

Minor

  • ci: fix codeclimate by @ccoVeille in #57
  • build(deps): bump crate-ci/typos from 1.28.2 to 1.28.3 in the all group by @dependabot in #56
  • doc: add popularity badge and stargazers graph by @ccoVeille in #58

Full Changelog: v1.3.0...v1.4.0