lolkek
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
module main.go
|
||||
|
||||
go 1.25.4
|
||||
|
||||
require gopkg.in/pipe.v2 v2.0.0-20140414041502-3c2ca4d52544 // indirect
|
||||
@@ -0,0 +1,2 @@
|
||||
gopkg.in/pipe.v2 v2.0.0-20140414041502-3c2ca4d52544 h1:WJH1qsOB4/zb/li+zLMn0vaAUJ5FqPv6HYLI3aQVg1k=
|
||||
gopkg.in/pipe.v2 v2.0.0-20140414041502-3c2ca4d52544/go.mod h1:UhTeH/yXCK/KY7TX24mqPkaQ7gZeqmWd/8SSS8B3aHw=
|
||||
@@ -0,0 +1,22 @@
|
||||
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))
|
||||
}
|
||||
Reference in New Issue
Block a user