1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-31 20:15:42 +02:00

gofmt: add Chinese translation (#17211)

This commit is contained in:
Shinsei 2025-07-26 01:31:11 +08:00 committed by GitHub
parent 3b6fb489e5
commit 10d2042e7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

20
pages.zh/common/gofmt.md Normal file
View file

@ -0,0 +1,20 @@
# gofmt
> 格式化 Go 源代码。
> 更多信息:<https://pkg.go.dev/cmd/gofmt>.
- 格式化文件并在控制台输出结果:
`gofmt {{源代码.go}}`
- 格式化文件并覆盖原文件:
`gofmt -w {{源代码.go}}`
- 格式化文件和简化代码并覆盖原文件:
`gofmt -s -w {{源代码.go}}`
- 打印所有(包括虚假的)错误:
`gofmt -e {{源代码.go}}`