title: Can 'go install' be made to work for executables with different names from the git repo?
body: <p>Go has a nice feature where you can <code>go install &lt;x&gt;</code> and it will download, build and install a binary.</p>
  <p>For example, on my local windows PC, <code>go install github.com/goreleaser/goreleaser</code> will find the latest release for goreleaser, download, build and install it to my local binaries path.</p>
  <p>I am working on a project where we would like to enable <code>go install</code>, but encounter a problem if the github repo name does not match the executable name. The GitHub CLI itself runs into the exact same problem:</p>
  <p>Example:</p>
  <pre class="lang-bash prettyprint-override"><code>go install github.com/cli/cli@latest
  go: downloading github.com/cli/cli v1.14.0
  go: github.com/cli/cli@latest: module github.com/cli/cli@latest found (v1.14.0), but does not contain package github.com/cli/cli
  </code></pre>
  <p>Is there a way to resolve this?</p>
  <hr />
  <p>Update: I worked out that I could directly reference the package via it's sub directory. In my particular instance this works: <code>go install github.com/OctopusDeploy/cli/cmd/octopus@latest</code></p>
  <p>This is a bit unpleasant, but works correctly. It doesn't work for the github CLI because their go.mod has a <code>replace</code> directive in it :-(</p>
  <p>Question: Can this be made nicer? Is there a way to put some sort of alias or configuration file so that <code>go install github.com/OctopusDeploy/cli@latest</code> can be used instead of <code>go install github.com/OctopusDeploy/cli/cmd/octopus@latest</code> ?</p>