osutil

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const EscapeRune = '\\'

Variables

This section is empty.

Functions

func ExecCmdCtxWithAttr

func ExecCmdCtxWithAttr(ctx context.Context, name string, args ...string) *exec.Cmd

func ExecCmdRunOutputs

func ExecCmdRunOutputs(ecmd *exec.Cmd) (sout []byte, serr []byte, _ error)

func ExecName

func ExecName(name string) string

func FilepathHasDirPrefix

func FilepathHasDirPrefix(s, prefix string) bool

func FilepathSplitAt

func FilepathSplitAt(s string, n int) string

Result does not start with separator.

func GoExec

func GoExec() string

func HomeEnvVar

func HomeEnvVar() string

func KillExecCmd

func KillExecCmd(cmd *exec.Cmd) error

func SetupExecCmdSysProcAttr

func SetupExecCmdSysProcAttr(cmd *exec.Cmd)

func ShellRunArgs

func ShellRunArgs(args ...string) []string

Types

type TmpFiles

type TmpFiles struct {
	Dir string
}

func NewTmpFiles

func NewTmpFiles(prefix string) *TmpFiles

func (*TmpFiles) MkdirInTmp

func (tf *TmpFiles) MkdirInTmp(path string) (string, error)

func (*TmpFiles) MkdirInTmpOrPanic

func (tf *TmpFiles) MkdirInTmpOrPanic(path string) string

func (*TmpFiles) RemoveAll

func (tf *TmpFiles) RemoveAll() error

func (*TmpFiles) WriteFileInTmp

func (tf *TmpFiles) WriteFileInTmp(path string, src []byte) (string, error)

func (*TmpFiles) WriteFileInTmp2OrPanic

func (tf *TmpFiles) WriteFileInTmp2OrPanic(path string, src string) string

func (*TmpFiles) WriteFileInTmpOrPanic

func (tf *TmpFiles) WriteFileInTmpOrPanic(path string, src []byte) string

Jump to

Keyboard shortcuts

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