gochips

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2019 License: MIT Imports: 5 Imported by: 8

README

gochips

Small useful pieces of golang code

Documentation

Index

Constants

View Source
const (
	StderrRedirectNone = iota
	StderrRedirectStdout
	StderrRedirectNull
)

Stderr redirection

Variables

View Source
var Doing func(arg interface{})

Doing printlns "$obj..." to stdout

View Source
var Info func(args ...interface{})

Info printlns to stdout

View Source
var IsVerbose = false

IsVerbose enables Verbose

View Source
var Output func(funcName, s string) error

Output is used by all functions

View Source
var Verbose func(subj string, args ...interface{})

Verbose If IsVerbose is true printlns VerbosePrefix + subj + ": " + ...args args are printed in %#v format (json-like) if jsonLike is true, %v othervide

View Source
var VerbosePrefix = "--- "

VerbosePrefix prefixes Verbose output

Functions

func ExitIfError

func ExitIfError(err error, args ...interface{})

ExitIfError s.e.

func ExitIfFalse

func ExitIfFalse(cond bool, args ...interface{})

ExitIfFalse s.e.

func PanicIfError

func PanicIfError(err error)

PanicIfError panics if err is not null

Types

type PipedExec

type PipedExec struct {
	// contains filtered or unexported fields
}

PipedExec allows to execute commands in pipe

func (*PipedExec) Command

func (Self *PipedExec) Command(name string, args ...string) *PipedExec

Command adds a command to a pipe

func (*PipedExec) Run

func (Self *PipedExec) Run(out io.Writer, err io.Writer) error

Run starts the pipe

func (*PipedExec) WorkingDir

func (Self *PipedExec) WorkingDir(wd string) *PipedExec

WorkingDir sets working directory for the last command

Jump to

Keyboard shortcuts

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