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() }