Skip to content

Instantly share code, notes, and snippets.

@ToQoz
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ToQoz/b6d0b75b5bcf50b55fba to your computer and use it in GitHub Desktop.
Save ToQoz/b6d0b75b5bcf50b55fba to your computer and use it in GitHub Desktop.
gomain() {
local f="/tmp/gomain-$$/main.go"
mkdir -p $(dirname $f)
cat <<_EOF_ > $f
package main
import (
"fmt"
)
func main() {
fmt.Println("Hello, gomain")
}
_EOF_
$EDITOR $f
cat $f
echo "---Output---"
go run $f
unlink $f
rmdir $(dirname $f)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment