3.4. Simplifying code
You can use the gofmt formatting tool to simplify your code.
Procedure
To simplify code in a given path, enter:
$ gofmt -s -w <code_path>Replace
<code_path>with the path to the code you want to simplify.To apply the changes, enter:
$ gofmt -w <code_path>Replace
<code_path>with the path to the code you want to format.