3.3. Previewing changes to code
You can use the gofmt formatting tool to preview changes done by formatting code in a given path. The output in unified diff format is printed to standard output.
Procedure
Show differences in your code in a given path:
$ gofmt -d <code_path>Replace
<code_path>with the path to the code you want to compare.