2

ubuntu下安装golang

 3 years ago
source link: https://studygolang.com/articles/35053?fr=sidebar
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

ubuntu下安装golang

iAeLv11408 · 4天之前 · 451 次点击 · 预计阅读时间 1 分钟 · 大约8小时之前 开始浏览    

golang官方编译器安装与配置 因为golang是用部分功能语言编写的,所有首先应安装gcc,

sudo apt-get install bison gawk gcc libc6-dev make

安装mercurial工具,用于提取golang的源代码

sudo apt-get install mercurial

提取golang的原代码

hg clone -r release https://go.googlecode.com/hg/ go

编译源代码

cd go/src

./all.bash

在.bashrc环境变量中加入golang配置

export GOROOT=~/go export GOARCH=386(64为的要设置成 amd64) export GOOS=linux export GOBIN=$GOROOT/bin/ export GOTOOLS=$GOROOT/pkg/tool/ export PATH=$PATH:$GOBIN:$GOTOOLS

使用.bashrc立即生效

source ~/.bashrc


有疑问加站长微信联系(非本文作者))

280

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:701969077


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK