util

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: MIT Imports: 13 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 CleanPath added in v0.4.5

func CleanPath(location string) (string, error)

CleanPath returns the absolute path to the mount location. If location is an empty string, nothing is done.

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 MacOS13OrNewer added in v0.5.0

func MacOS13OrNewer() bool

MacOS13OrNewer returns if the current OS is macOS 13 or newer.

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 RosettaRunning added in v0.5.0

func RosettaRunning() bool

RosettaRunning checks if Rosetta process is running.

func ShellSplit added in v0.4.3

func ShellSplit(cmd string) []string

ShellSplit splits 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