Go语言极简入门教程: Go Notes

20190504

最近工作上需要用到Go,发现真是容易上手的一门语言。比起JAVA的tutorial都看得头昏眼花,Go实在是很小清新了。开始学了两个周左右,项目就要贡献代码了。还是个非常新的Gopher,记一下自己走过的一些路。

  1. Go tour
    这个真是最好的入门教程了,跟着练一遍非常的清爽哈哈。
    https://tour.golang.org/list

  2. 环境配置
    环境配置很简单,这里有一个值得注意的地方
    https://stackoverflow.com/questions/7970390/what-should-be-the-values-of-gopath-and-goroot
    GOPATH is discussed in the cmd/go documentation
    https://golang.org/cmd/go/#hdr-GOPATH_environment_variable
    GOROOT is discussed in the installation instructions
    https://golang.org/doc/install#tarball_non_standard
    这是一个完整的例子:
    https://www.youtube.com/watch?v=XCsL89YtqCs

  3. Go build
    如果不在IDE的话,我们需要把Go Project进行编译来执行。这也算从python过来的小伙伴一个不太熟悉的地方。
    go install vs go build
    https://pocketgophers.com/go-install-vs-go-build/Both

  • go install and go build will compile the package in the current directory when ran without additional arguments.
  • If the package is package main, go build will place the resulting executable in the current directory. go install will put the executable in $GOPATH/bin (using the first element of $GOPATH, if you have more than one).
  • If the package is not package main, go install and go build will compile the package, displaying any errors encountered
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值