bx.ee

Jeremiah Gowdy

Go Scripting

You can actually use Go as a scripting language. Install gorun with go get github.com/erning/gorun and create a new file called hello.go:

/// 2>/dev/null ; gorun "$0" "$@" ; exit $?

package main

func main() {
	println("Hello world!")
}

Save the file and chmod +x hello.go. Then ./hello.go and you’re scripting with Go. The Go compiler is fast enough that startup times are reasonable.