GO语言学习环境搭建

开发环境

操作系统:Fedora-Workstation-x86_64-27-1.6

Go版本:1.9.2

下载安装包:https://golang.org/dl/

选择Linux的tar包go1.9.2.linux-amd64.tar.gz

#注意:安在go包需要能访问google先!

wget https://dl.google.com/go/go1.9.2.linux-amd64.tar.gz

tar -zxvf go1.9.2.linux-amd64.tar.gz

cp -rf ./go /usr/local

cd /usr/local/go/bin

./go version

配置环境变量

vim /etc/profile

 

source /etc/profile

go的基本命令:

GO语言学习环境搭建

查看单个函数的帮助文档:

godoc fmt Println

构建本地go帮助网页(如果操作系统不能访问国外网络,此操作可能会失败):

godoc -http=:8120

配置vim

以下配置参考文章:

https://github.com/astaxie/build-web-application-with-golang/blob/master/zh/01.4.md

http://blog.csdn.net/xxy0403/article/details/53909252

https://www.cnblogs.com/yuuyuu/p/5222980.html

如果配置不成功可能是网络原因或者vim版本不对。

mkdir -p ~/.vim/bundle

git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim

vi /root/.vimrc

 

然后在vim内执行命令(时间比较久):先输入PluginInstall然后,GoInstallBinaries

创建开发目录

mkdir -p ~/go/src

mkdir -p ~/go/pkg

mkdir -p ~/go/bin

cd ~/go/src

 

go run hello.go

学习资源

https://golang.org/

https://golang.org/doc/

https://gowalker.org/

https://github.com/astaxie

https://github.com/astaxie/build-web-application-with-golang/blob/master/zh/preface.md

https://gocn.io/

https://github.com/astaxie/go-best-practice/blob/master/ebook/zh/preface.md

https://golangtc.com/

https://studygolang.com/

https://github.com/Unknwon/go-fundamental-programming

本文作者: GavinDong

版权属于: GavinDong博客

文章链接: https://gavindong.com/2038.html

如果使用过程中遇到问题,可 **点击此处** 交流沟通。

版权所有,转载时必须以链接形式注明作者和原始出处及本声明。

(0)

相关文章

发表回复

登录后才能评论

评论列表(1条)

  • ag的头像
    ag 2018.01.22 07:56

    在线手册:http://www.shouce.ren/api/view/a/5581