開發工具:GoLandhtml
|– bingolang
|– build數組
|–build_dev/test/release.shbash
|– gen-go函數
|– config工具
|– dev/test/release.yml性能
|– pkg開發工具
|–controllerui
|–daothis
|–rpc
|–service
|–*_impl.go
|–*_test.go
|–*_mock.go
|– vendor
|– README.md
/* …… */
或者 // ……
增長註釋, //
以後應該加一個空格_
if接受初始化語句,約定以下方式創建局部變量
if err := file.Chmod(0664); err != nil {
return err
}複製代碼
方法的接收器的名稱 通常採用strcut的第一個字母且爲小寫,而不是this,me或者self
type rpcClient struct {
once sync.Once
}
func (r *rpcClient) newCodec(contentType string) (codec.NewCodec, error) {
//
}
var b bool
,直接使用它做爲判斷條件,而不是使用它和true/false進行比較sync.Mutex
或者相似的用於同步的成員。必須使用指針傳遞,避免成員拷貝