cast

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package cast provides save casting functions for converting between types without panicking.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Array20

func Array20[A any](slice []A) ([20]A, error)

Array20 casts a slice to an array of length 32.

func Array32

func Array32[A any](slice []A) ([32]A, error)

Array32 casts a slice to an array of length 32.

func Array65

func Array65[A any](slice []A) ([65]A, error)

Array65 casts a slice to an array of length 65.

func Array8

func Array8[A any](slice []A) ([8]A, error)

Array8 casts a slice to an array of length 2.

func EthAddress

func EthAddress(b []byte) (common.Address, error)

EthAddress casts a byte slice to an Ethereum address.

func Must20

func Must20[A any](slice []A) [20]A

Must20 casts a slice to an array of length 20.

func Must32

func Must32[A any](slice []A) [32]A

Must32 casts a slice to an array of length 32.

Types

This section is empty.

Jump to

Keyboard shortcuts

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