go學習筆記

go build,go test,go tool pprof ,go tool cover。建議了解 -race 參數(shù)的使用

推薦工具

gofmt/goimport/goreturn

推薦等級:必須使用 ,應調(diào)整為 save 后自動 format。

調(diào)整代碼格式。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 推薦補充但暫時可忽略

代碼規(guī)范

參照 go 項目本身的代碼規(guī)范,猶豫的地方可參考 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. 如非必要,不要將函數(shù),類型或常量聲明為公有。

  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 資源

http://www.itdecent.cn/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

最后編輯于
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

  • 將兩個(或更多)語句放在一行書寫,它們 必須用分號 (’;’) 分隔。一般情況下,你不需要分號。 init函數(shù)和m...
    涵仔睡覺閱讀 3,878評論 0 8
  • 簡介 Go語言是谷歌2009年推出,2012年開始在生產(chǎn)環(huán)境使用的一種全新的編程語言,是從2007年末由Rober...
    _Eamon閱讀 191評論 0 0
  • 類型 引用類型特指slice、map、channel這三種預定義類型。 內(nèi)置函數(shù)new按指定類型長度分配零值內(nèi)存,...
    蕭然AND沐橦閱讀 541評論 0 0
  • 下篇:GO——學習筆記(二) 參考: https://github.com/astaxie/build-web-a...
    就天邊閱讀 1,610評論 2 7
  • 孤單,最先理解這個詞的意思,是一年前吧!那時項目的失敗,感情上的失敗,一切一切將我打垮。頭疼不止,每日睡覺都要吃吃...
    萌小滿閱讀 622評論 0 0

友情鏈接更多精彩內(nèi)容