I've identified several changes to the PATH variable in Bash that aren't listed in e.g. /etc/profile
, ~/.profile
, .bash_profile
, ~/.bashrc
.
The following snippet from the Go installation page mentions that packages may change the environment.
How can I see changes to the environment made by packages?
https://golang.org/doc/install
The package should put the /usr/local/go/bin directory in your PATH
environment variable. You may need to restart any open Terminal
sessions for the change to take effect.
Best Answer
The
/etc/profile
file, which Bash executes for login shells, includes the following content:It's the
path_helper
program that sets up thePATH
environment variable.man path_helper
:In particular, the Go installer creates a file called
go
in/etc/paths.d
with the following content: