Skip to content

Add Go's standard binary directory to the Zsh PATH #46

Description

@barbatdev

Problem

The shared Zsh profile prepends $HOME/.local/bin but does not include Go's executable installation directory. With an empty GOBIN, go install writes binaries to the first GOPATH entry plus /bin (commonly $HOME/go/bin). The installation succeeds, but the shell can keep resolving an older duplicate from $HOME/.local/bin or fail to find the newly installed binary.

Reproduction

  1. Use the profile with go env GOBIN empty and the default GOPATH.
  2. Install a CLI normally, for example:
    go install github.com/gentleman-programming/gentle-ai/v2/cmd/gentle-ai@v2.4.0-rc.1
  3. Run command -v gentle-ai and gentle-ai version.

Expected behavior

The standard go install ...@version command should make the newly installed binary discoverable without requiring a per-command GOBIN override. The Go binary directory should take precedence over stale duplicates in generic user-local directories.

Current behavior

go install writes the requested version under the default Go binary directory, while the profile prioritizes $HOME/.local/bin; the active command can therefore remain on an older version.

Requested outcome

  • Resolve the effective Go executable directory from non-empty GOBIN, otherwise from the first GOPATH entry plus /bin.
  • Add it to the shared Zsh PATH with deterministic precedence.
  • Avoid duplicate PATH entries and preserve compatibility when Go is unavailable.
  • Add a shell smoke check covering the default GOPATH case.

Environment

  • Zsh profile managed by this repository
  • Go using its default GOPATH-based binary destination
  • mise activation also participates in PATH ordering

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions