-
-
Save rkulla/bbe82f81fa1baa283a5fde2aec8fb5a9 to your computer and use it in GitHub Desktop.
go wrapper to "go run" implicitly when you type "go *.go"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Simple go wrapper for typing "go file.go" instead of "go run file.go" | |
# Allows flags and wildcards as usual. | |
# | |
# Installation: Copy this wrapper to first in PATH, e.g. $GOPATH/bin | |
realgo=/usr/local/go/bin/go | |
if (( $# > 0 )) && [[ "$1" = *.go ]]; then | |
$realgo run "$@" | |
else | |
$realgo "$@" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment