generic

package
v0.0.0-...-c234f5e Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Max

func Max[T cmp.Ordered](x, y T) T

func Sum

func Sum[T Number](vals ...T) T

Types

type Integer

type Integer int

type LinkedList

type LinkedList[T any] struct {
	// contains filtered or unexported fields
}

type MyList

type MyList[T any] interface {
	Add(index int, val T)
	Append(val T)
}

type MyType

type MyType[T Stringer] struct {
	// contains filtered or unexported fields
}

type Number

type Number interface {
	~int | int64 | float32 | float64
}

type Pair

type Pair[T any] struct {
	A, B T
}

func Swap

func Swap[T any](p Pair[T]) Pair[T]

type Person

type Person struct {
	// contains filtered or unexported fields
}

func (Person) String

func (p Person) String() string

implement Stringer

type Stringer

type Stringer interface {
	String() string
}

Jump to

Keyboard shortcuts

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