utils

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToInt added in v0.5.0

func BoolToInt(b bool) uint8

BoolToInt converts a boolean to an integer.

func FindFile added in v0.7.0

func FindFile(dir string, regex string) (string, error)

FindFile searches for a file in a directory that matches a regular expression.

func OpenFileForWriting

func OpenFileForWriting(dir, filename string) (*os.File, error)

OpenFileForWriting opens a file for writing, creating the directory if it doesn't exist.

func RunCmd

func RunCmd(cmnd string, arg []string) ([]byte, []byte, error)

RunCmd runs a command.

func RunCmdWithEnv

func RunCmdWithEnv(cmnd string, env string, arg []string) ([]byte, []byte, error)

RunCmdWithEnv runs a command with the specified environment variables.

func RunCmdWithStdin added in v0.7.0

func RunCmdWithStdin(cmnd string, arg []string, stdin string) ([]byte, []byte, error)

RunCmdWithStdin runs a command with standard input.

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