util

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FuncMap = template.FuncMap{
	"Title":             strings.Title,
	"ToLower":           strings.ToLower,
	"CleanGoIdentifier": CleanGoIdentifier,
	"GenerateUUID":      uuid.New,
}

@TODO how can we make these type of helpers extensible?

Functions

func AppendProjectEnvToCmdEnv

func AppendProjectEnvToCmdEnv(envMap map[string]string, envList []string) []string

AppendProjectEnvToCmdEnv will add all the keys and values from envMap into envList as key-value pair strings (e.g.: "key=value")

func CleanGoIdentifier

func CleanGoIdentifier(identifier string) string

func CreateDirIfDoesNotExist

func CreateDirIfDoesNotExist(path string) error

func ExecuteCommand

func ExecuteCommand(cmd *exec.Cmd, pathPrefix string, envars []string)

func ExecuteCommandOutput

func ExecuteCommandOutput(cmd *exec.Cmd, pathPrefix string, envars []string) string

ExecuteCommandOutput runs the command and returns its combined standard output and standard error.

func GetCwd

func GetCwd() string

func IndentString

func IndentString(content string, spaces int) string

IndentString will Add x space char padding at the beginging of each line.

func ItemInSlice

func ItemInSlice(slice []string, target 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