源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

ubuntu下搭建Go语言(golang)环境

  • 时间:2021-05-10 13:42 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:ubuntu下搭建Go语言(golang)环境
Go语言是谷歌2009发布的第二款开源编程语言。Go语言专门针对 多处理器系统应用程序的编程进行了优化,使用Go编译的程序可以媲美C或C++代码的速度,而且更加安全、支持并行进程。 [img]http://img.1sucai.cn/uploads/article/2018010710/20180107100147_0_22892.jpg[/img] 还是我自己的电脑,我自己安装的是ubuntu 12.04版本的,直接介绍安装吧!其实搭建环境很简单!
[u]复制代码[/u] 代码如下:
sudo apt-get install python-setuptools python-dev build-essential //安装mercurial依赖 sudo easy_install mercurial                                       //安装mercurial
[b]获取go语言包[/b]
[u]复制代码[/u] 代码如下:
hg clone -r release https://go.googlecode.com/hg/ go
[b]编译安装golang[/b]
[u]复制代码[/u] 代码如下:
cd go/src ./all.bash
ubuntu到这里其实就安装成功了,要配置PATH了,就是我们的windows里的环境变量
[u]复制代码[/u] 代码如下:
Installed Go for linux/386 in /home/widuu/source/go Installed commands in /home/widuu/source/go/bin *** You need to add /home/widuu/source/go/bin to your PATH.
然后我们弄个文件试试
[u]复制代码[/u] 代码如下:
sudo vim hello.go package main import "fmt" func main() {         fmt.Printf("hello, 微度网络n") } go build hello.go ./hello
输出hello,微度网络 [img]http://img.1sucai.cn/uploads/article/2018010710/20180107100148_1_54411.png[/img]
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部