github.com/myitcv/gobin is an experimental, module-aware command to install/run main packages.

Compared to the Go 1.11 series cmd/go, with gobin you:

  • get some of the behaviour of go get, go install and go run combined
  • can have multiple versions of a tool available without needing to worry about setting PATH
  • have the equivalent of go get whilst in module-aware mode but this does not modify your go.mod; indeed you can choose whether you want to run in global mode (the default) or main-module mode for the install/run operation
  • can run a main package without the overhead of the linking phase, e.g. within code generation

More detailed on the rationale etc are covered in the main README and the FAQ.

gobin is an experiment, as such there are no expectations over its future.

There are a number of potential outcomes, not limited to the following list:

  • it dies; the hypothesis being tested by gobin proves incorrect, unworkable etc
  • it lives on as a separate tool outside of the Go distribution
  • parts of gobin are absorbed into the cmd/go tool
  • a variant of gobin is vendored and distributed alongside the cmd/go tool, much like godoc was in in Go 1.11 and earlier

As ever, contributions in the form of feedback, issues and PRs, greatly appreciated.