utils

package
v0.0.0-...-7db9a95 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains[T comparable](s []T, e T) bool

func ContainsCaseInsensitive

func ContainsCaseInsensitive(s []string, e string) bool

func Filter

func Filter[T any](data []T, f func(T) bool) []T

func FormatList

func FormatList(list []string) string

func Map

func Map[T, U any](data []T, f func(T) U) []U

func Min

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

func RealiseSliceOfPointers

func RealiseSliceOfPointers[T any](list []*T) []T

func Reverse

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

func SliceInsertAt

func SliceInsertAt[T any](s []T, val T, idx int) []T

func SliceMove

func SliceMove[T comparable](s []T, val T, idx int) []T

func SliceMoveAt

func SliceMoveAt[T any](s []T, from, to int) []T

func SliceOfPointers

func SliceOfPointers[T any](list []T) []*T

func SliceRemoveAt

func SliceRemoveAt[T any](s []T, idx int) []T

func SliceRemoveVal

func SliceRemoveVal[T comparable](s []T, val T) []T

func Start

func Start(input string) error

func Timer

func Timer(name string) func()

Types

type Stack

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

func NewStack

func NewStack[T any]() *Stack[T]

func (*Stack[T]) Len

func (s *Stack[T]) Len() int

func (*Stack[T]) Peak

func (s *Stack[T]) Peak() *T

func (*Stack[T]) Pop

func (s *Stack[T]) Pop() *T

func (*Stack[T]) Push

func (s *Stack[T]) Push(item T)

func (*Stack[T]) String

func (s *Stack[T]) String() string

Jump to

Keyboard shortcuts

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