types

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: MIT Imports: 1 Imported by: 4

Documentation

Overview

Package types implements the functions, types, and interfaces for the module.

Package types implements the functions, types, and interfaces for the module.

Package types implements the functions, types, and interfaces for the module.

Package types implements the functions, types, and interfaces for the module.

Package types implements the functions, types, and interfaces for the module.

Package types implements the functions, types, and interfaces for the module.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stringer

func Stringer[T String](t T) string

Stringer converts a string-like type to a string.

func Zero

func Zero[T any]() (zero T)

Zero is the zero value for a type.

func ZeroOr

func ZeroOr[T comparable](v T, def T) T

ZeroOr returns def if v is the zero value. Decrypted: use cmp.ZeroOr instead.

Types

type Boolean

type Boolean interface {
	~bool
}

Boolean is an interface that represents a boolean type. It is implemented by the built-in bool type.

type Complex

type Complex = constraints.Complex

Complex is an interface that represents a complex64 or complex128 number.

type Const

type Const interface {
	Number | Boolean | ~string
}

Const is an interface that represents a value that is either a Number, a Boolean, or a string. It is used to define constants in Go.

type Float

type Float = constraints.Float

Float is an interface that represents a float32 or float64.

type Integer

type Integer = constraints.Integer

Integer is an interface that represents an integer type.

type Number

type Number interface {
	Float | Integer | Complex
}

Number is an interface that represents any number type. It includes all the interfaces defined above.

type Ordered

type Ordered = constraints.Ordered

Ordered is an interface that represents any ordered type.

type Signed

type Signed = constraints.Signed

Signed is an interface that represents a signed integer type.

type Slice

type Slice[T any] interface{ ~[]T }

type String

type String interface {
	~string | ~[]byte | ~[]rune
}

String is an interface that represents a string-like type. It can be a string, a byte slice, or a rune slice.

type Unsigned

type Unsigned = constraints.Unsigned

Unsigned is an interface that represents an unsigned integer type.

Jump to

Keyboard shortcuts

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