utils

package
v0.0.0-...-1ea0709 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapKeysToSlice

func MapKeysToSlice[T comparable, K any](m map[T]K) []T

func RandomElementFromSet

func RandomElementFromSet[T comparable](s map[T]struct{}) T

func RandomElementFromSlice

func RandomElementFromSlice[T any](s []T) (T, int)

Selects a random element from a slice and returns it and it's index

func ReadFileIntoSlice

func ReadFileIntoSlice(filename string, sliceToLoad *[]string) error

func RemoveIndex

func RemoveIndex[T any](s []T, index int) []T

Takes a slice and an index and returns a new slice with the element at s[index] removed

Types

This section is empty.

Jump to

Keyboard shortcuts

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