1. 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, where: q! Is not guaranteed 1 set system environment variables
[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
2 compile and make it take effect
[Plain]View plaincopyprint?
- Source/etc/profile
3. 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
-