Closed Akilan1999 closed 2 years ago
Gofmt is a tool that automatically formats Go source code.
Gofmt’d code is:
easier to write: never worry about minor formatting concerns while hacking away,
easier to maintain: mechanical changes to the source don’t cause unrelated changes to the file’s formatting; diffs show only the real changes.
uncontroversial: never have a debate about spacing or brace position ever again!
gofmt -s -w .
source: https://go.dev/blog/gofmt
Rejected - this commit doesn't add any value, and it changes formatting to a different one than the current one used (leading to formatting war, let's not start one)
Go fmt:
Gofmt is a tool that automatically formats Go source code.
Gofmt’d code is:
easier to write: never worry about minor formatting concerns while hacking away,
easier to maintain: mechanical changes to the source don’t cause unrelated changes to the file’s formatting; diffs show only the real changes.
uncontroversial: never have a debate about spacing or brace position ever again!
command:
source: https://go.dev/blog/gofmt