godo is an alternative to go run. It's useful when you want to avoid the go build/go install, /path/to/somebin cycle. There's also a bash completion script, which makes it easy to quickly invoke a Go package from your GOPATH.
godo differs from go run in the following respects:
godo github.com/anacrolix/missinggo/cmd/nop vs.go run $GOPATH/src/github.com/anacrolix/missinggo/cmd/nop/*.go$TMPDIR/godo/$pkgname.$$. This means that:$pkgname.$$, e.g. torrent.123, where the package name of the binary was torrent, and its PID is 123.godo calls to the same package. For example a go run invocation for a large application on my system has a mandatory ~0.8s delay even if the files haven't changed. godo has this at 0.04s, because it's able to reuse the existing binary.$ godo -h
godo is an alternative to `go run`.
Usage:
godo [go build flags] <package spec> [binary arguments]
godo -h | --help
# first run
$ time godo github.com/anacrolix/missinggo/cmd/nop
real 0m0.244s
user 0m0.177s
sys 0m0.071s
$ time godo github.com/anacrolix/missinggo/cmd/nop
real 0m0.046s
user 0m0.012s
sys 0m0.022s
# historical binaries
$ ls -tr $TMPDIR/godo/ | grep nop.
nop.40586
nop.40590
go install github.com/anacrolix/godo@latest
Bash completion:
go install github.com/anacrolix/godo/go-list-cmd@latest
. "$GOPATH/src/github.com/anacrolix/godo/complete.sh"
$ godo github.com/anacrolix/godo cmd/go run "$GOPATH/src/github.com/anacrolix/godo/"*.go cmd/go list github.com/anacrolix/...
<all my herptastic Go code>