run

package module
v0.0.0-...-f5cbe2f Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2013 License: MIT Imports: 4 Imported by: 0

README

run

Channel-friendly wrapper to run commands in Go.

example

cmd := exec.Command("ls", "-l")

// reader
lines := make(chan string)
go func() {
	for line := range lines {
		fmt.Println("LINE: ", line)
	}
}()

// run `cmd`, writing the output to the lines channel
ret, err := Run(cmd, lines)

if err != nil {
	panic(err)
}
fmt.Printf("Command exit value: %s\n", ret)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cmd *exec.Cmd, lines chan string) (error, error)

Run runs the command and returns a channel of output lines, errors and result of cmd.Wait

Types

This section is empty.

Jump to

Keyboard shortcuts

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