Formatting the Code
Explore how to use Go's gofmt tool to format source code automatically, maintain idiomatic style, and perform basic refactoring, helping you produce clean, readable Go code and save development time.
We'll cover the following...
We'll cover the following...
Formatting in Go #
Go’s authors didn’t want endless discussions about code-style for the Go-language. Specifically, the discussions that were indeed, a waste of precious development time for so many languages in the past. So, they made a tool: go fmt (or with more possibilities: gofmt). It is a pretty-printer that imposes the official, standard code formatting and styling on the Go source-code. It is ...