Set the system environment variable [plain] viewplaincopyprint? Vi/etc/profile is added at the end (press the I key to enter the editing status, drag the cursor down, add the following, and press the: wq key to save and exit the settings system environment variable)
[Plain]View plaincopyprint?
- Vi/etc/profile
Add at the end (press the I key to enter the editing status, drag the cursor down, add the following, and then press: wq to save and exit, where: q! Yes, force exit without saving)
[Plain]View plaincopyprint?
- Export GOROOT =/usr/local/go
- Export GOBIN = $ GOROOT/bin
- Export GOPKG = $ GOROOT/pkg/tool/linux_amd64
- Export GOARCH = amd64
- Export GOOS = linux
- Export PATH =.: $ PATH: $ GOBIN: $ GOPKG
Compile and make it take effect
[Plain]View plaincopyprint?
- Source/etc/profile
If you can see the version number, the configuration is successful!
[Plain]View plaincopyprint?
- Go version
[Plain]View plaincopyprint?
- Go version go1.2.2 linux/amd64