Examples (5)
Format Go source files in the current directory
Format a specific Go package in your import path (`$GOPATH/src`)
go fmt path/to/packageFormat the package in the current directory and all subdirectories (note the `...`)
go fmt ./...Print what format commands would've been run, without modifying anything
go fmt -nPrint which format commands are run as they are run
go fmt -xmade by @shridhargupta | data from tldr-pages