unsafecast

package
v3.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package unsafecast provides utilties for performing unsafe type casts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sizeof

func Sizeof[T any]() uintptr

Sizeof returns the size of T in bytes.

func Slice

func Slice[From, To any](in []From) []To

Slice reinterprets a slice of one type as a slice of another type. Slice does not perform any type conversion or validation; it simply reinterprets the underlying memory.

The length and capacity of the output slice are scaled according to the sizes of the From and To types.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL