All notable changes to this project are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Major: backwards incompatible package updates
- Minor: feature additions
- Patch: bug fixes, backward compatible model and function changes, etc.
- GitHub action definition for builds and tests
- Related bug fixes and cleanup
- Added test coverage
- Related bug fixes and cleanup
- Additional examples
- Improved slice support
- Various bugfixes
- Added tests
This is a full library rewrite for go v1.18+ to take advantage of generic functions and types.
syntax example:
intVal := cast.To[int]("8.31") // 8 (int)
intVal := cast.To[int]("Hi!") // 0 (int)
intVal, err := cast.ToE[int]("Hi!") // 0, unable to cast "Hi!" of type string to int (int, error)
- All existing exported cast functions have been removed (
ToString(any) string
,ToStringE(any) (string, error)
, etc.)
- All previous exported cast functions have replaced with a single generic function (and it's
error
counterpart):To[T any](any) T ToE[T any](any) (T, error)
- Refactoring
ToSlice*
andToMap
language
ToUint64Slice
ToUint64SliceE
ToInt64Slice
ToInt64SliceE
v1.0.0
is the production release of the previous development work.