Ubuntu下安装go语言
1. 下载go源代码
- sudo apt-get install mercurial
- hg clone -u release https://code.google.com/p/go
- cd ~/go/src
- ./all.bash
- ALL TESTS PASSED
- ---
- Installed Go for linux/amd64 in /home/you/go.
- Installed commands in /home/you/go/bin.
- *** You need to add /home/you/go/bin to your $PATH. ***
3. 测试go
vi hello.go:
- package main
- import "fmt"
- func main() {
- fmt.Printf("hello, world\n")
- }
- go run hello.go
更新go
- cd ~/go/src
- hg pull
- hg update release
- ./all.bash
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。