mirror of
https://github.com/tldr-pages/tldr.git
synced 2025-09-09 04:53:17 +02:00
gofmt: add page (#1730)
This commit is contained in:
parent
e29e511da6
commit
5054170ce7
1 changed files with 19 additions and 0 deletions
19
pages/common/gofmt.md
Normal file
19
pages/common/gofmt.md
Normal file
|
@ -0,0 +1,19 @@
|
|||
# gofmt
|
||||
|
||||
> Tool for formatting Go source code.
|
||||
|
||||
- Format a file and display the result to the console:
|
||||
|
||||
`gofmt {{source.go}}`
|
||||
|
||||
- Format a file, overwriting the original file in-place:
|
||||
|
||||
`gofmt -w {{source.go}}`
|
||||
|
||||
- Format a file, and then simplify the code, overwriting the original file:
|
||||
|
||||
`gofmt -s -w {{source.go}}`
|
||||
|
||||
- Print all (including spurious) errors:
|
||||
|
||||
`gofmt -e {{source.go}}`
|
Loading…
Add table
Reference in a new issue