util

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 M3 added in v0.6.7

func M3() bool

M3 returns if the current device is an Apple M3 device.

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 MacOS13OrNewerOnM1 added in v0.5.3

func MacOS13OrNewerOnM1() 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 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