知识卡片
统一排版降低协作噪声
go fmt或gofmt把可解析源码按共同排版规则调整,使团队更少围绕空白、缩进和花括号布局反复争论。格式化处理排版,不能自动改好命名、修复业务逻辑或让无效语法变正确。
原书不推荐使用工具属于当时观点,不影响理解其用途。使用统一格式仍需清楚代码语义:外观整齐与行为正确是两项检查。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 0 / 10 条
还没有人提交反馈。
在整书笔记中的位置
原书出处 · 1 处
- · 查看原书依据
Fmt runs the command 'gofmt -l -w' on the packages named by the import paths. It prints the names of the files
参考来源
- 位置:《Go语言编程 完整版》第07章《工程管理》(来源项目book-sources:extracted/Go语言编程 完整版/_epub-src/text/part0000_split_003.html;spine 4,归一字符[2666,2776))
- 结论依据:原文展示go fmt/gofmt用途及格式化前后对比,明确其能力边界而不采纳反工具的个人建议。
- 原始内容:Fmt runs the command 'gofmt -l -w' on the packages named by the import paths. It prints the names of the files