Skip to content

An implement of os/exec, but add timeout option

License

Notifications You must be signed in to change notification settings

codeskyblue/exec

Repository files navigation

exec

Build Status

An implement of os/exec, but add timeout option

Example

package main import ( "fmt" "github.com/shxsun/exec" "time" ) func main(){cmd := exec.Command("sleep", "2") cmd.Timeout = time.Second * 1 output, err := cmd.Output() if err != nil{fmt.Println(err) return } fmt.Println("Output: ", string(output)) } 

About

An implement of os/exec, but add timeout option

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages