go学习笔记 - Go语言中文社区

go学习笔记


go build,go test,go tool pprof ,go tool cover。建议了解 -race 参数的使用

推荐工具

gofmt/goimport/goreturn

推荐等级:必须使用 ,应调整为 save 后自动 format。

调整代码格式。goimport 会自动 import go package,在大仓库下速度比较慢,不建议使用。

golint /gometalint

推荐等级:必须使用

go-plus 默认使用 gometalint 。gometalint 自动包含了常见的 lint 如 govet,golint 等。

使用时建议仔细阅读 lint message,了解 lint 相关的详细解释。尽量保证提交代码无 error 和 warnning。

以下 lint error/warnning 可暂时忽略:

  1. 变量名中使用 Id

  2. public 方法或结构没有注释

其中 1 属于历史遗留问题 2 推荐补充但暂时可忽略

代码规范

参照 go 项目本身的代码规范,犹豫的地方可参考 go 的标准库

必读文章,建议至少看 3 遍以上。

https://golang.org/doc/effective_go.html

https://github.com/golang/go/wiki/CodeReviewComments

http://www.runoob.com/go/go-tutorial.html

补充

  1. 如非必要,不要将函数,类型或常量声明为公有。

  2. 注释建议使用简单的英文。

  3. 注释应该针对是 why 而非 how 和 what。

测试:

  1. http://big-elephants.com/2017-09/this-programmer-tried-to-mock-an-http-slash-2-server-in-go-and-heres-what-happened/

  2. https://www.markphelps.me/testing-api-clients-in-go/

git status # 这一步不是必须的,但良好习惯应该确认下被更改的文件是自己所修改的
git diff # 这一步不是必须的,用于查看详细的代码修改
git add <modified_file1> <modified_file2> <modified_dir3> ...
git commit -m "IssueId:**** The message for this commit, which explains why you modify the related code"
git status # 确认一下所有的更改都commit了
git log # 这一步不是必须的,用于查看历史的commit记录

plugin

https://plugins.jetbrains.com/plugin/5047-go-language-golang-org-support-plugin
https://github.com/go-lang-plugin-org/go-lang-idea-plugin/wiki/v1.0.0-Setup-initial-project

go

https://golang.org/dl/

go-project 练习

https://github.com/avelino/awesome-go#data-structures

go github 资源

https://www.jianshu.com/p/f814504c8f05
https://github.com/sjwhitworth/golearn

go example

https://gobyexample.com/

其他 gan

微软剑桥研究院关于GAN介绍 p153
http://www.nowozin.net/sebastian/talks/mlss2018/MLSS%202018%20-%20Nowozin%20-%20GANs%20introduction.pdf
Deepmind 关于GAN介绍
http://www.gatsby.ucl.ac.uk/~balaji/Understanding-GANs.pdf
Goodfellow CVPR上关于GAN介绍
http://www.iangoodfellow.com/slides/2018-06-18.pdf

版权声明:本文来源简书,感谢博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
原文链接:https://www.jianshu.com/p/3aa0d417bc8e
站方申明:本站部分内容来自社区用户分享,若涉及侵权,请联系站方删除。
  • 发表于 2020-01-09 21:50:52
  • 阅读 ( 1234 )
  • 分类:Go

0 条评论

请先 登录 后评论

官方社群

GO教程

猜你喜欢