Skip to content

Don't suggest adding GOROOT/bin and GOPATH/bin to the PATH.#463

Merged
ChronosMasterOfAllTime merged 1 commit into
go-nv:masterfrom
adk-swisstopo:install
Jul 2, 2025
Merged

Don't suggest adding GOROOT/bin and GOPATH/bin to the PATH.#463
ChronosMasterOfAllTime merged 1 commit into
go-nv:masterfrom
adk-swisstopo:install

Conversation

@adk-swisstopo

@adk-swisstopo adk-swisstopo commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

The installation instructions say to make the shell init script execute the output of goenv init -. That output contains this among other things:

export PATH="${GOENV_ROOT}/shims:${PATH}"

The main point of that line is to make the go command resolve to $GOENV_ROOT/shims/go such that goenv has control over the default go.

The installation instructions later say to add this after the eval in order to let "goenv manage GOPATH and GOROOT":

export PATH="$GOROOT/bin:$PATH"
export PATH="$PATH:$GOPATH/bin"

This effectively overrides the first line as $GOROOT/bin is also expected to contain a go binary. However that binary is not controlled by goenv. Furthermore AFAICT these two lines do not make "goenv manage GOPATH and GOROOT".

This has confused at least one other user.

This change removes the section about GOROOT and GOPATH as I don't see why it would belong in the goenv installation instructions.

Fixes #462.

The installation instructions say to make the shell init script execute the
output of `goenv init -`. That output contains this among other things:
```
export PATH="${GOENV_ROOT}/shims:${PATH}"
```
The main point of that line is to make the `go` command resolve to
`$GOENV_ROOT/shims/go` such that `goenv` has control over the default `go`.

The installation instructions later say to add this after the eval in order to
let "goenv manage GOPATH and GOROOT":
```
export PATH="$GOROOT/bin:$PATH"
export PATH="$PATH:$GOPATH/bin"
```

This effectively overrides the first line as `$GOROOT/bin` is also expected to
contain a `go` binary. However that binary is not controlled by `goenv`.
Furthermore AFAICT these two lines do not make "goenv manage GOPATH and GOROOT".

This has confused at least [one other user](go-nv#186 (comment)).

This change removes the section about GOROOT and GOPATH as I don't see why it
would belong in the goenv installation instructions.
@ChronosMasterOfAllTime ChronosMasterOfAllTime merged commit 30eab56 into go-nv:master Jul 2, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

installations instructions prevent use of the goenv go shim

2 participants