Bobochka
6/29/2017 - 1:19 PM

Execute Go source code like a shebang

Execute Go source code like a shebang

$ cat a.go
//usr/bin/env go run $0 $@; exit

package main

import "fmt"

func main() {
        fmt.Println("hello world")
}
$ chmod a+x a.go
$ ./a.go
hello world
$