Running the "go fmt" command recursively

To go tool works on packages*, so you can run it on the current package and any subdirectories like this

go fmt ./...

*nitpickers note, some go commands also work with files, which is confusing and always leads to misunderstandings.

5 Likes