Skip to content

doc: setting GOROOT is not necessary when installing to custom location  #25002

Closed
@rhcarvalho

Description

@rhcarvalho

What version of Go are you using (go version)?

go version go1.10.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

What did you do?

  1. Visit https://golang.org/dl/ and download a go1.10.1 tarball

  2. Install to a custom location:

    $ cd /tmp
    $ tar -xzf ~/Downloads/go1.10.1.darwin-amd64.tar.gz
    $ go/bin/go env GOROOT
    /tmp/go
    
  3. Visit https://golang.org/doc/install#tarball_non_standard and see the installation instructions

What did you expect to see?

No need to set GOROOT, as it is indeed not necessary in Go 1.10.

What did you see instead?

For example, if you installed Go to your home directory you should add commands like the following to $HOME/.profile:

export GOROOT=$HOME/go1.X
export PATH=$PATH:$GOROOT/bin

Note: GOROOT must be set only when installing to a custom location.


In #18678 (comment), @minux proposed to derive GOROOT from os.Executable...

And then we can eliminate all mentions of GOROOT in user facing documents (in fact, we should actively discourage setting GOROOT in user facing documents.)

The change was implemented in CL 42533, but the documentation was not updated to remove suggestions to set GOROOT.

Activity

added this to the Go1.11 milestone on Apr 24, 2018
gopherbot

gopherbot commented on Apr 30, 2018

@gopherbot
Contributor

Change https://golang.org/cl/110435 mentions this issue: doc: remove GOROOT custom install instruction

locked and limited conversation to collaborators on Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues describing a change to documentation.FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      Participants

      @rhcarvalho@ianlancetaylor@gopherbot

      Issue actions

        doc: setting GOROOT is not necessary when installing to custom location · Issue #25002 · golang/go