golang-exercises/script/main.go

23 lines
300 B
Go
Raw Normal View History

2024-04-18 12:51:00 +02:00
package main
import (
"fmt"
"log"
"os"
"github.com/bitfield/script"
)
func main() {
if len(os.Args) != 2 {
os.Exit(0)
}
contents, err := script.File("./main.go").Match("import").String()
if err != nil {
log.Fatal(err)
}
fmt.Print(contents)
script.Exec("ping localhost").Stdout()
}