Run gofmt on all project files
To run go formatter recursively on all project’s files simply use:
gofmt -s -w .
To print the files that has been changed add
gofmt -l -s -w .
-ddisplay diffs instead of rewriting files
-llist files where formatting differs from gofmt’s
-ssimplifies the code
-wwrites results back