Is it possible to have a cli-package (package main
) which is "go-getable", but the binary is installed under a different name?
For example to have a repository github.com/exaring/foo-cli
But go get github.com/foo/foo-cli
would install a binary called foo
(not foo-cli
)?
The point is to have an expressive repository name but a short and easy to type executable.
If you're fine with the user running go build
instead of go get
, you can do this:
go build -o foo github.com/foo/foo-cli
Otherwise, you can keep all the CLI code in foo-cli
and put the main
function in foo
.