anytypes

package
v0.0.0-...-98c81bf Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equals

func Equals(v1 any, v2 any) bool

Return true if the values given are equal. Else, false. TODO: accomodate structs, slices, arrays, maps and other structures

func ExpectKind

func ExpectKind(v any, expected string)

Panic if the value given is not of the kind given. TODO: Test after collections is rolled out

func ExpectType

func ExpectType(v any, expected string)

Panic if the value given is not of the type given. TODO: Test after collections is rolled out

func HasKind

func HasKind(v any, expected string) bool

Return true if the kind of the value given equals the expected kind given. Else, false.

func HasType

func HasType(v any, expected string) bool

Return true if the type of the value given equals the expected type given. Else, false.

func IsArray

func IsArray(v any) bool

Return true if the value given is an array. Else, false.

func IsBasic

func IsBasic(v any) bool

Return true if the value given is a basic type. Else, false.

func IsComparable

func IsComparable(v any) bool

Return true if the value given is comparable. Else, false.

func IsMap

func IsMap[V any](v V) bool

Return true if the value given is a map. Else, false.

func IsOrdered

func IsOrdered(v any) bool

Return true if the value given adheres to cmp.Ordered. Else, false.

func KindString

func KindString(v any) string

Return the kind of the value given as a string.

func TypeEquals

func TypeEquals(v1 any, v2 any) bool

Return true if the values given are of the same type. Else, false.

func TypeString

func TypeString(v any) string

Types

type Kind

type Kind struct {
	Name string
	Tags []string
}

Jump to

Keyboard shortcuts

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