utils

package
v3.0.0 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 FindIndex

func FindIndex[T constraints.Ordered](input []T, val T, eq func(T, T) bool) int

func Max

func Max[T constraints.Ordered](a, b T) T

Max provides a generic method for getting the greater of two input values. In the event that the inputs are equal, the second input will be returned.

func Min

func Min[T constraints.Ordered](a, b T) T

Min provides a generic method for getting the lesser of two input values. In the event that the inputs are equal, the second input will be returned.

func Reverse

func Reverse[T constraints.Ordered](input []T) []T

Reverse returns a new slice containing the elements of the input slice in reverse order.

Types

This section is empty.

Jump to

Keyboard shortcuts

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