util

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToPath added in v0.4.0

func AppendToPath(path, dir string) string

AppendToPath appends directory to PATH.

func HomeDir

func HomeDir() string

HomeDir returns the user home directory.

func MacOS added in v0.4.0

func MacOS() bool

MacOS returns if the current OS is macOS.

func ParseTemplate

func ParseTemplate(body string, values interface{}) ([]byte, error)

ParseTemplate parses template with body and values and returns the resulting bytes.

func RandomAvailablePort added in v0.4.0

func RandomAvailablePort() int

RandomAvailablePort returns an available port on the host machine.

func RemoveFromPath added in v0.4.0

func RemoveFromPath(path, dir string) string

RemoveFromPath removes directory from PATH.

func ShellSplit added in v0.4.3

func ShellSplit(cmd string) []string

ShellSplit splids cmd into arguments using.

func WriteTemplate

func WriteTemplate(body string, file string, values interface{}) error

WriteTemplate writes template with body to file after applying values.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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