Skip to content

hpcloud/run

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Channel-friendly wrapper to run commands in Go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages