Golang 实践经验

栏目: Go · 发布时间: 7年前

内容简介:如果对实现不够熟悉,很难知道t是什么,fr是什么。
  • 编码风格: https://github.com/golang/go/wiki/CodeReviewComments
  • 编码规范:代码提交前使用 go fmt 格式化代码
  • 虽然 Go 推荐使用比较短的名字来命名,但是不要太短,例如l, a, r,容易看不懂,尤其是当嵌套层次深了之后。例如gRPC实现中的一段代码:
frame, err := t.framer.fr.ReadFrame()
if err == io.EOF || err == io.ErrUnexpectedEOF {
    return nil, err
}

如果对实现不够熟悉,很难知道t是什么,fr是什么。


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

New Dark Age

New Dark Age

James Bridle / Verso Books / 2018-7-17 / GBP 16.99

As the world around us increases in technological complexity, our understanding of it diminishes. Underlying this trend is a single idea: the belief that our existence is understandable through comput......一起来看看 《New Dark Age》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试