1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-09-09 22:13:20 +02:00

gofmt: add page (#1730)

This commit is contained in:
Nalin Bhardwaj 2017-12-02 13:56:20 +05:30 committed by Agniva De Sarker
parent e29e511da6
commit 5054170ce7

19
pages/common/gofmt.md Normal file
View 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}}`