utils

package
v2.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EscapeSpaces added in v2.15.0

func EscapeSpaces(s string) string

EscapeSpaces escapes all space characters with a backslash (\)

func ExpandEnvSafe

func ExpandEnvSafe(s string) string

ExpandEnvSafe replaces ${var} or $var in the string according to the values of the current environment variables. As opposed to os.ExpandEnv, ExpandEnvSafe won't remove the dollar in '$(...)' See https://golang.org/src/os/env.go?s=963:994#L22 for the original function

func ExpandField

func ExpandField(input string) string

ExpandField expands environment variables in field

func ExpandSliceField

func ExpandSliceField(input []string) []string

ExpandSliceField expands environment variables in every entries of a slice field

func ExpandUser

func ExpandUser(path string) (string, error)

ExpandUser expands tild and env vars in unix paths

func GetHomeDir

func GetHomeDir() string

GetHomeDir returns '~' as a path

Types

This section is empty.

Jump to

Keyboard shortcuts

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