utils

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanString

func CleanString(s string) string

func ClickOption added in v0.4.0

func ClickOption(options []string, separator string, cx int, offset int) (int, string)

func DeleteExtraSpace

func DeleteExtraSpace(s string) string

func FileExited added in v0.8.0

func FileExited(path string) bool

FileExited check file exited

func FilePath added in v0.8.0

func FilePath(path string) string

FilePath replace ~ -> $HOME

func GetKey added in v0.3.0

func GetKey(key interface{}) string

func Home added in v0.8.0

func Home() (string, error)

Home returns the home directory for the executing user.

This uses an OS-specific method for discovering the home directory. An error is returned if a home directory cannot be detected.

func HomeUnix added in v0.8.0

func HomeUnix() (string, error)

func HomeWindows added in v0.8.0

func HomeWindows() (string, error)

func IsDirector added in v0.8.0

func IsDirector(path string) bool

IsDirector IsDir

func LabelsToStringArr

func LabelsToStringArr(labelsMapString string) []string

Convert labels which like '{"k8s-app":"kube-dns"}' to '[]string{"k8s-app=kube-dns"}'.

func MaxFloat64

func MaxFloat64(arr []float64) float64

func MinFloat64

func MinFloat64(arr []float64) float64

func NormalizeLinefeeds

func NormalizeLinefeeds(str string) string

NormalizeLinefeeds - Removes all Windows and Mac style line feeds

func OptionsMapToString

func OptionsMapToString(optionsMap map[string]string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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