Documentation ¶
Overview ¶
util contains small standalone utility functions. This should have no dependencies on other server packages.
Index ¶
- func Max[T constraints.Ordered](a, b T) T
- func MaxTime(a, b time.Time) time.Time
- func Min[T constraints.Ordered](a, b T) T
- func MinTime(a, b time.Time) time.Time
- func SliceHead[S ~[]E, E any](s S, n int) S
- func SliceTail[S ~[]E, E any](s S, n int) S
- func SortSlice[S ~[]E, E constraints.Ordered](slice S)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Max ¶
func Max[T constraints.Ordered](a, b T) T
Min returns the maximum of two comparable values.
func Min ¶
func Min[T constraints.Ordered](a, b T) T
Min returns the minimum of two comparable values.
func SortSlice ¶
func SortSlice[S ~[]E, E constraints.Ordered](slice S)
SortSlice sorts the given slice of an ordered type. Sort is not guaranteed to be stable.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.