util

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AskForConfirmation

func AskForConfirmation(s string) (bool, error)

askForConfirmation asks the user for confirmation. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user.

func EnvExists

func EnvExists(key string) bool

func GetEnv

func GetEnv(key, fallback string) string

func InArray added in v0.0.39

func InArray(a []string, v string) (ret bool, i int)

* InArray returns true if the value exists in the array

func IsBoolArrayTrue added in v0.0.39

func IsBoolArrayTrue(array []bool) bool

* IsBoolArrayTrue checks whether the array contains only true elements

func Max

func Max(x, y int64) int64

int64 max function

func Min

func Min(x, y int64) int64

int64 min function

func RandStringBytesMaskImprSrc

func RandStringBytesMaskImprSrc(n int) string

func RemoveCommonElements added in v0.0.39

func RemoveCommonElements(a, b []string) []string

* RemoveCommonElements removes the common elements and returns the first array

func TruncateString added in v0.0.39

func TruncateString(str string, n int) string

func YesNoToBool

func YesNoToBool(s string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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