Skip to content

Instantly share code, notes, and snippets.

@dolmen dolmen/
Created Nov 16, 2016

What would you like to do?
Wrapping a Go source with a few lines of shell to make it directly runnable (chmod u+x)
f=$(mktemp -t XXXXXXXX.go); sed -n '3,$p' "$0" >"$f"; go run "$f"; e=$?; rm -f "$f"; exit $?
package main
import "fmt"
func main() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.