utils

package
v2.8.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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