typeutil

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 1 Imported by: 80

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IntToBool

func IntToBool[T Signed](a T) bool

func Keys

func Keys[K comparable, V any](m map[K]V) []K

Keys returns a slice of the keys of the map. based with go 1.18 generics

func Reverse

func Reverse[T any](s []T) []T

func TimeEpoch

func TimeEpoch(epoch int64) time.Time

func TimeStamp

func TimeStamp(stamp int64) time.Time

Types

type Signed added in v0.4.6

type Signed interface {
	~int | ~int8 | ~int16 | ~int32 | ~int64
}

Signed is a constraint that permits any signed integer type. If future releases of Go add new predeclared signed integer types, this constraint will be modified to include them.

Jump to

Keyboard shortcuts

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