linux set go environment variable

 After downloading, unzip and copy to the stored directory

sudo vim /etc/profile

 Press i to enter edit mode, add the following at the end

export GOROOT=/usr/local/dev/go

export PATH=$PATH:/usr/local/dev/go/bin

Press esc to exit editing, enter: wq to save

At last

source /etc/profile

Effective immediately

(If it fails to take effect, log out the current user and log in again)

Enter go or go env to verify

Guess you like

Origin blog.csdn.net/takujo/article/details/107836830