doc: update macOS PATH instructions for go install tools
Updates doc/install and doc/manage-install to explicitly mention adding the GOPATH bin directory to the user's PATH on macOS.
This addresses the suggestion made in: https://github.com/golang/go/issues/39531#issuecomment-1879299980
Specifically, added a note and example workflow setup instruction for appending export PATH="$PATH:$(go env GOPATH)/bin" to target shell profiles.
diff --git a/_content/doc/install.html b/_content/doc/install.html
index ea798fd..902c60f 100644
--- a/_content/doc/install.html
+++ b/_content/doc/install.html
@@ -146,6 +146,17 @@
<code>PATH</code> environment variable. You may need to restart any
open Terminal sessions for the change to take effect.
</p>
+ <p>
+ <strong>Note:</strong> To use tools installed via <code>go install</code>, you should also add the Go bin directory (typically <code>$HOME/go/bin</code>) to your <code>PATH</code>.
+ You can do this by adding the following line to your shell profile (e.g., <code>~/.zshrc</code> or <code>~/.bash_profile</code>):
+ </p>
+ <pre class="CopyPaste">
+ <span>export PATH="$PATH:$(go env GOPATH)/bin"</span>
+ <button aria-label="Copy and paste the code.">
+ <img class="CopyPaste-icon" src="/images/icons/copy-paste.svg" />
+ <img class="CopyPaste-icon CopyPaste-icon-dark" src="/images/icons/copy-paste-dark.svg" />
+ </button>
+ </pre>
</li>
<li>
Verify that you've installed Go by opening a command prompt and typing
diff --git a/_content/doc/manage-install.html b/_content/doc/manage-install.html
index c361a80..1b6d48c 100644
--- a/_content/doc/manage-install.html
+++ b/_content/doc/manage-install.html
@@ -94,6 +94,10 @@
Under Linux and FreeBSD, edit /etc/profile or $HOME/.profile. If you installed Go with the macOS package, remove the /etc/paths.d/go file.
</p>
+<p>
+<strong>Note:</strong> If you manually added the Go bin directory (e.g., <code>$HOME/go/bin</code>) to your shell profile for tools installed via <code>go install</code>, you should also remove that entry.
+</p>
+
</li>
</ol>
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I spotted some possible problems with your PR:
1. You have a long 146 character line in the commit message body. Please add line breaks to long lines that should be wrapped. Lines in the commit message body should be wrapped at ~76 characters unless needed for things like URLs or tables. (Note: GitHub might render long lines as soft-wrapped, so double-check in the Gerrit commit message shown above.)
Please address any problems by updating the GitHub PR.
When complete, mark this comment as 'Done' and click the [blue 'Reply' button](https://go.dev/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it) above. These findings are based on heuristics; if a finding does not apply, briefly reply here saying so.
To update the commit title or commit message body shown here in Gerrit, you must edit the GitHub PR title and PR description (the first comment) in the GitHub web interface using the 'Edit' button or 'Edit' menu entry there. Note: pushing a new commit to the PR will not automatically update the commit message used by Gerrit.
For more details, see:
(In general for Gerrit code reviews, the change author is expected to [log in to Gerrit](https://go-review.googlesource.com/login/) with a Gmail or other Google account and then close out each piece of feedback by marking it as 'Done' if implemented as suggested or otherwise reply to each review comment. See the [Review](https://go.dev/doc/contribute#review) section of the Contributing Guide for details.)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Congratulations on opening your first change. Thank you for your contribution!
Next steps:
A maintainer will review your change and provide feedback. See
https://go.dev/doc/contribute#review for more info and tips to get your
patch through code review.
Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
THANK YOU. A few suggestions for you.
The package installs the Go distribution to /usr/local/go. The package
should put the /usr/local/go/bin directory in your
<code>PATH</code> environment variable. You may need to restart anyLet's document how the PATH is updated, so that we're mirror
the uninstall instruction, e.g.:
The package installs the Go distribution to /usr/local/go and
adds the /usr/local/go/bin directory to your <code>PATH</code>
environment variable by creating /etc/paths.d/go.
<code>PATH</code> environment variable. You may need to restart any
open Terminal sessions for the change to take effect.Rather that this uncertain instruction, let's add this as
an explicit final second-to-last step at the end of the
installation steps, immediately before the "Verify that
you've installed Go by opening…" step, e.g.
Restart any open Terminal sessions for the changes to your
PATH to take effect.
<strong>Note:</strong> To use tools installed via <code>go install</code>, you should also add the Go bin directory (typically <code>$HOME/go/bin</code>) to your <code>PATH</code>.
You can do this by adding the following line to your shell profile (e.g., <code>~/.zshrc</code> or <code>~/.bash_profile</code>):
</p>
<pre class="CopyPaste">
<span>export PATH="$PATH:$(go env GOPATH)/bin"</span>
<button aria-label="Copy and paste the code.">
<img class="CopyPaste-icon" src="/images/icons/copy-paste.svg" />
<img class="CopyPaste-icon CopyPaste-icon-dark" src="/images/icons/copy-paste-dark.svg" />
</button>
</pre>
</li>Let's make this a distinct step instead of a note on an existing step, e.g.
<li>
Open the package file you downloaded and …
</li>
<li>
Add the Go bin directory (typically <code>$HOME/go/bin</code>) to
your <code>PATH</code>. This is the installation location that's
used by <code>go install</code>.
<p>
You can do this by adding the following line to your shell profile
(e.g., <code>~/.zshrc</code> or <code>~/.bash_profile</code>):
</p>
<pre class="CopyPaste">
…
</pre>
</li>
<li>Remove the Go bin directory from your <code>PATH</code> environment variable.In the installation instructions we just refer to /usr/local/go.
And, we reserve the term "Go bin" for $HOME/go/bin.
So this phrase should read:
Remove /usr/local/go
Under Linux and FreeBSD, edit /etc/profile or $HOME/.profile. If you installed Go with the macOS package, remove the /etc/paths.d/go file.We should break to a new line (<br>) or paragraph (<p>) so the macOS instructions are on equal footing with the Linux/FreeBSD instructions.
<p>Like with the install, make this a separate list item (<li>)
vs. a note on the an existing list item.
<strong>Note:</strong> If you manually added the Go bin directory (e.g., <code>$HOME/go/bin</code>) to your shell profile for tools installed via <code>go install</code>, you should also remove that entry.Suggested edit:
If you manually added the Go bin directory (typically
<code>$HOME/go/bin</code>) to your shell profile, for example
by adding <code>export PATH="$PATH:$(go env GOPATH)/bin"</code>,
remove that entry.
<li>Remove the Go bin directory from your <code>PATH</code> environment variable.
<p>
Under Linux and FreeBSD, edit /etc/profile or $HOME/.profile. If you installed Go with the macOS package, remove the /etc/paths.d/go file.
</p>
<p>
<strong>Note:</strong> If you manually added the Go bin directory (e.g., <code>$HOME/go/bin</code>) to your shell profile for tools installed via <code>go install</code>, you should also remove that entry.
</p>
</li>Recommend a separate <li> here as well
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |