{"id":174,"date":"2020-11-10T10:54:22","date_gmt":"2020-11-10T02:54:22","guid":{"rendered":"https:\/\/www.92k.xin\/?p=174"},"modified":"2020-11-10T10:54:23","modified_gmt":"2020-11-10T02:54:23","slug":"centos%e5%ae%89%e8%a3%85golang%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/www.92k.xin\/?p=174","title":{"rendered":"CentOS\u5b89\u88c5golang\u73af\u5883"},"content":{"rendered":"\n
golang\uff08https:\/\/www.golang.org\/<\/a>\uff09\u7ecf\u5e38\u5bb9\u6613\u88ab\u5899\uff0c\u6211\u4eec\u627e\u5230\u4e86\u4e00\u4e2a\u6bd4\u8f83\u9760\u8c31\u70b9\u7684\u5b98\u65b9\u7f51\u7ad9\uff1ahttps:\/\/golang.google.cn\/<\/a> \u3002<\/p>\n\n\n\n \u6211\u4eec\u7684\u4e0b\u8f7d\u5730\u5740\u6765\u6e90\uff0c\u5c31\u9760google.cn\u8fd9\u4e2a\u7f51\u7ad9\u6765\u83b7\u53d6\u3002<\/p>\n\n\n\n \u5e9f\u8bdd\u8865\u591a\u5c11\uff0c\u76f4\u63a5\u5c55\u793a\u3002<\/p>\n\n\n\n 1\u3001\u4e0b\u8f7d\u5b89\u88c5<\/p>\n\n\n\n 2\u3001\u73af\u5883\u914d\u7f6e\uff0cvi \/etc\/profile.d\/go.sh\u3002 \u8fd9\u6837\u65e2\u53ef\u4ee5\u52a0\u8f7d\u73af\u5883\uff0c\u4e5f\u4e0d\u4f1a\u7834\u574f\u5176\u4ed6\u73af\u5883\u53d8\u91cf\u3002\u771f\u597d\u3002<\/p>\n\n\n\n 3\u3001\u73af\u5883\u751f\u6548 source \/etc\/profile<\/p>\n\n\n\n 4\u3001go version<\/p>\n\n\n\n 5\u3001go env<\/p>\n\n\n\n <\/p>\n","protected":false},"excerpt":{"rendered":" golang\uff08https:\/\/www.golang.org\/\uff09\u7ecf\u5e38\u5bb9\u6613\u88ab\u5899\uff0c\u6211\u4eec\u627e\u5230\u4e86\u4e00\u4e2a\u6bd4\u8f83\u9760\u8c31\u70b9\u7684\u5b98\u65b9\u7f51\u7ad9… <\/p>\nwget https:\/\/golang.google.cn\/dl\/go1.15.4.linux-amd64.tar.gz\ntar -zxf go1.15.4.linux-amd64.tar.gz\nmv go \/web\/<\/pre><\/div>\n\n\n\n
export GOROOT=\/web\/go\nexport GOBIN=$GOROOT\/bin\nexport GOPATH=$GOROOT\/common\nexport PATH=$PATH:$GOBIN\nexport GOPROXY=\"https:\/\/goproxy.cn,direct\"<\/pre><\/div>\n\n\n\n
go version go1.15.4 linux\/amd64<\/pre><\/div>\n\n\n\n
GO111MODULE=\"\"\nGOARCH=\"amd64\"\nGOBIN=\"\/web\/go\/bin\"\nGOCACHE=\"\/root\/.cache\/go-build\"\nGOENV=\"\/root\/.config\/go\/env\"\nGOEXE=\"\"\nGOFLAGS=\"\"\nGOHOSTARCH=\"amd64\"\nGOHOSTOS=\"linux\"\nGOINSECURE=\"\"\nGOMODCACHE=\"\/web\/go\/common\/pkg\/mod\"\nGONOPROXY=\"\"\nGONOSUMDB=\"\"\nGOOS=\"linux\"\nGOPATH=\"\/web\/go\/common\"\nGOPRIVATE=\"\"\nGOPROXY=\"https:\/\/goproxy.cn,direct\"\nGOROOT=\"\/web\/go\"\nGOSUMDB=\"sum.golang.org\"\nGOTMPDIR=\"\"\nGOTOOLDIR=\"\/web\/go\/pkg\/tool\/linux_amd64\"\nGCCGO=\"gccgo\"\nAR=\"ar\"\nCC=\"gcc\"\nCXX=\"g++\"\nCGO_ENABLED=\"1\"\nGOMOD=\"\"\nCGO_CFLAGS=\"-g -O2\"\nCGO_CPPFLAGS=\"\"\nCGO_CXXFLAGS=\"-g -O2\"\nCGO_FFLAGS=\"-g -O2\"\nCGO_LDFLAGS=\"-g -O2\"\nPKG_CONFIG=\"pkg-config\"\nGOGCCFLAGS=\"-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=\/tmp\/go-build479832871=\/tmp\/go-build -gno-record-gcc-switches\"<\/pre><\/div>\n\n\n\n