utils

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const EnvAmHostname = "AM_HOSTNAME"

EnvAmHostname will override the hostname in all machine names.

Variables

This section is empty.

Functions

func CloseSafe added in v0.10.1

func CloseSafe[T any](ch chan T)

TODO remove if that speeds things up

func GetVersion

func GetVersion() string

func Hostname

func Hostname() string

func J

func J(states []string) string

J joins state names into a single string

func Jw

func Jw(states []string, sep string) string

Jw joins state names into a single string with a separator.

func RandId added in v0.10.1

func RandId(strLen int) string

RandId generates a random ID of the given length (defaults to 8).

func SlicesEvery added in v0.10.1

func SlicesEvery[S1 ~[]E, S2 ~[]E, E comparable](col1 S1, col2 S2) bool

SlicesEvery returns true if all elements of coll2 are in coll1.

func SlicesNone added in v0.10.1

func SlicesNone[S1 ~[]E, S2 ~[]E, E comparable](col1 S1, col2 S2) bool

SlicesNone returns true if none of the elements of coll2 are in coll1.

func SlicesUniq added in v0.10.1

func SlicesUniq[S ~[]E, E comparable](coll S) S

func SlicesWithout added in v0.10.1

func SlicesWithout[S ~[]E, E comparable](coll S, el E) S

Types

This section is empty.

Jump to

Keyboard shortcuts

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