util

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AverageDuration

func AverageDuration(dur []time.Duration) (avg time.Duration)

func ExecCost

func ExecCost(fn func()) time.Duration

func IndexInt

func IndexInt(ints []int, n int) int

func IndexStringSlice

func IndexStringSlice(strings []string, str string) int

func IsRuneMatch

func IsRuneMatch(p, r rune) bool

func IsRunesMatch

func IsRunesMatch(pattern, runes []rune) bool

func Max

func Max[Ord cmp.Ordered](a, b Ord) Ord

func MaxInt8

func MaxInt8(a, b int8) int8

func RangeFileLines

func RangeFileLines(filename string, fn func(string) bool) error

func ReadAllLines

func ReadAllLines(filename string) []string

func Reverse

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

func SliceEqual

func SliceEqual(a, b []int) bool

Types

type Float

type Float float64

func (Float) Hash

func (v Float) Hash() uintptr

type Int

type Int int

func (Int) Hash

func (v Int) Hash() uintptr

type Result

type Result int
const (
	Equal Result = iota
	Less
	More
)

type Str

type Str string

func (Str) Hash

func (v Str) Hash() uintptr

Jump to

Keyboard shortcuts

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