Skip to content

codeskyblue/exec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

 
 
 

Languages