Go 学习路径 -- 相关基础

本贴最后更新于 2403 天前,其中的信息可能已经时异事殊

现在开始接触 Go 一段时间了,基本路径就是看基础学习材料,开始写项目,有问题找解决问题的方法。这里记录一下学习过程。

go 相关文章

Golang 支持在一个平台下生成另一个平台可执行程序的交叉编译功能。

1、Mac下编译Linux, Windows平台的64位可执行程序:
$ CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build test.go
$ CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build test.go
2、Linux下编译Mac, Windows平台的64位可执行程序:
$ CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build test.go
$ CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build test.go
3、Windows下编译Mac, Linux平台的64位可执行程序:
$ SET CGO_ENABLED=0SET GOOS=darwin3 SET GOARCH=amd64 go build test.go
$ SET CGO_ENABLED=0 SET GOOS=linux SET GOARCH=amd64 go build test.go

go 基础学习材料

GO 学习路径—系统包

1. flag 包

After all flags are defined, call
flag.Parse()
to parse the command line into the defined flags.

2. sync 包

  • 参考:锁和 sync 包
  • 参考:协程(goroutine)与通道(channel)
  • A WaitGroup waits for a collection of goroutines to finish. The main goroutine calls Add to set the number of goroutines to wait for. Then each of the goroutines runs and calls Done when finished. At the same time, Wait can be used to block until all goroutines have finished.

GO 学习路径—第三方开发包

1. glog 日志包

  • Leveled execution logs for Go.
  • 官网:https://code.google.com/p/google-glog/
  • The repository contains an open source version of the log package
    used inside Google. The master copy of the source lives inside
    Google, not here.

2. goconfig 配置文件工具包

  • golang

    Go 语言是 Google 推出的一种全新的编程语言,可以在不损失应用程序性能的情况下降低代码的复杂性。谷歌首席软件工程师罗布派克(Rob Pike)说:我们之所以开发 Go,是因为过去 10 多年间软件开发的难度令人沮丧。Go 是谷歌 2009 发布的第二款编程语言。

    497 引用 • 1386 回帖 • 324 关注

相关帖子

欢迎来到这里!

我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。

注册 关于
请输入回帖内容 ...