文档不相同:
gofmt -h
usage: gofmt [flags] [path ...] -cpuprofile string write cpu profile to this file -d display diffs instead of rewriting files -e report all errors (not just the first 10 on different lines) -l list files whose formatting differs from gofmt's -r string rewrite rule (e.g., 'a[b:len(a)] -> a[b:]') -s simplify code -w write result to (source) file instead of stdout
4条答案
按热度按时间b09cbbtk1#
Also see
go doc cmd/gofmt
ycl3bljg2#
在我看来,文档需要更新以匹配
gofmt -h
的输出。而不是让gofmt -h
更新以反映文档?如果是这样,我是否可以通过修改
cmd/gofmt
中的doc.go
来为这个PR打开一个分支?所以我有一点小贡献😅
vuv7lop33#
我理解了,
gofmt -h
是正确的,但在其他地方不正确。欢迎大家贡献。
pxy2qtax4#
https://golang.org/cl/170679提到了这个问题:
cmd/gofmt: have the doc.go match -h output