Documentation ¶
Index ¶
- func CleanFilePath(filePath string) (string, bool)
- func GenerateRandomString(n int) (string, error)
- func RemoveDuplicates[T comparable](in []T) []T
- func SliceInt32ToInt(in []int32) (out []int)
- func SliceUint64ToInt64(in []uint64) (out []int64)
- func SortInt32Slice[T constraints.Ordered](x []T)
- func StringFirstN(s string, n int) string
- type Comparable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanFilePath ¶ added in v0.8.21
func GenerateRandomString ¶
Taken from https://gist.github.com/dopey/c69559607800d2f2f90b1b1ed4e550fb GenerateRandomString returns a securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func RemoveDuplicates ¶ added in v0.8.20
func RemoveDuplicates[T comparable](in []T) []T
func SliceInt32ToInt ¶ added in v0.8.21
func SliceUint64ToInt64 ¶ added in v0.8.21
func SortInt32Slice ¶
func SortInt32Slice[T constraints.Ordered](x []T)
func StringFirstN ¶ added in v0.7.1
Taken from kAdor here: https://stackoverflow.com/a/41604514
Types ¶
type Comparable ¶ added in v0.7.3
type Comparable[T constraints.Ordered] []T
Comparable generic for sorting in increasing order.
func (Comparable[T]) Len ¶ added in v0.7.3
func (x Comparable[T]) Len() int
func (Comparable[T]) Less ¶ added in v0.7.3
func (x Comparable[T]) Less(i, j int) bool
func (Comparable[T]) Swap ¶ added in v0.7.3
func (x Comparable[T]) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.