gobin icon indicating copy to clipboard operation
gobin copied to clipboard

proposal: fall-through from main-module to global mode

Open myitcv opened this issue 5 years ago • 0 comments

It already appears to be a common situation (well, for me at least 👍) to have some tools installed as dependencies of a module in some situations, with a global fallback where that is not the case.

We can achieve this with a bit of work:

path=$(gobin -mod=readonly -nonet -p github.com/zmb3/gogetdoc 2> /dev/null || gobin -nonet -p github.com/zmb3/gogetdoc 2> /dev/null)
$path -run -help

I think it makes sense to offer this behaviour via a flag to gobin. It would work for any of the modes: install, run, version or print, but not download.

myitcv avatar Oct 24 '18 11:10 myitcv