gotools

package module
v0.0.0-...-3a4bef0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(s string, substrings []string) map[string]bool

Contains checks if the string contains any of the substrings in the list.

func EndsWith

func EndsWith(s string, substrings []string) map[string]bool

EndsWith checks if the string ends with any of the substrings in the list.

func EraseDelimiter

func EraseDelimiter(input string, delimiters []string, n int) (string, error)

removes all specified delimiters from the input string `delimiters“ is a slice of strings to be removed `n` specifies the number of replacements (-1 for all of them) returns the cleaned string and an error if any

func GenerateRandomBool

func GenerateRandomBool() bool

GenerateRandomBool generates a random boolean value.

func GenerateRandomInt

func GenerateRandomInt() int

GenerateRandomInt generates a random integer.

func GenerateRandomIntBetween

func GenerateRandomIntBetween(min, max int) int

GenerateRandomIntBetween generates a random integer between min and max.

func Generate_random_n_string

func Generate_random_n_string(n int) string

Generate_random_n_string generates a random string of length n.

func Generate_random_string

func Generate_random_string(lengths ...int) string

Generate_random_string generates a random string of length n, or a default length if no argument is provided.

func GrabCWD

func GrabCWD() string

GrabCWD returns the current working directory.

func GrabExecutableName

func GrabExecutableName() string

GrabExutableName returns the name of the current executable

func GrabExecutablePath

func GrabExecutablePath() string

GrabExecutablePath returns the path of the current executable

func GrabHomeDir

func GrabHomeDir() string

GrabHomeDir returns the current user's home directory.

func GrabUsername

func GrabUsername() string

GrabUsername returns the current user's username.

func IntToString

func IntToString(i int) string

IntToString converts an integer to a string.

func StartsWith

func StartsWith(s string, substrings []string) map[string]bool

StartsWith checks if the string starts with any of the substrings in the list.

func StringToBoolean

func StringToBoolean(s string) bool

StringToBoolean converts a string to a boolean.

func StringToInt

func StringToInt(s string) int

StringToInt converts a string to an integer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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