22 lines
294 B
Go
22 lines
294 B
Go
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))
|
|
} |