package main import ( "fmt" "log" "gopkg.in/pipe.v2" ) func main() { args := []string{"25"} p := pipe.Line( pipe.ReadFile("go.mod"), pipe.Exec("grep",args...), ) output, err := pipe.CombinedOutput(p) if err != nil { log.Fatal("Shit happened") } fmt.Println(string(output)) }