Skip to content

v2.0.0

Latest

Choose a tag to compare

@lunemec lunemec released this 22 Sep 14:23
792e517

Highlights

  • Replaced reflection and the hand-written integer conversion matrix with one generic checked cast.
  • Added uintptr and named integer support.
  • Added SliceTInto and SliceTUncheckedInto for reuse of caller-owned buffers. Successful Into conversions perform zero allocations.
  • Reduced allocations when aggregating slice overflow errors.
  • Added exhaustive boundary tests, fuzzing, race coverage, linting, and cross-architecture CI.

Breaking changes

  • The module path is now github.com/lunemec/as/v2.
  • Go 1.24 or newer is required.
  • T and the named checked helpers accept integer types directly. Values stored in any must be type-asserted, and pointers must be dereferenced first.
  • InvalidTypeError and automatic pointer dereferencing have been removed; unsupported source types now fail at compile time.

Migration

go get github.com/lunemec/as/v2
import "github.com/lunemec/as/v2"

value := any(int64(42))
n, err := as.T[int8](value.(int64))

pointer := new(int64)
*pointer = 42
n, err = as.T[int8](*pointer)

Full changelog: v1.1.2...v2.0.0