util

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 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 WriteTemplate

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

WriteTemplate writes template with body to file after applying values.

Types

type SHA256 added in v0.4.0

type SHA256 [32]byte

func SHA256Hash added in v0.4.0

func SHA256Hash(s string) SHA256

SHA256Hash computes a sha256sum of a string.

func (SHA256) String added in v0.4.0

func (s SHA256) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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