Forrest logo
back to context overview

gofmt

List of commands for gofmt:

  • gofmt:tldr:0a3f9 gofmt: Format a file, and then simplify the code, overwriting the original file.
    $ gofmt -s -w ${source-go}
    try on your machine
    explain this command
  • gofmt:tldr:2b79f gofmt: Format a file and display the result to the console.
    $ gofmt ${source-go}
    try on your machine
    explain this command
  • gofmt:tldr:2d8f1 gofmt: Format a file, overwriting the original file in-place.
    $ gofmt -w ${source-go}
    try on your machine
    explain this command
  • gofmt:tldr:d9aed gofmt: Print all (including spurious) errors.
    $ gofmt -e ${source-go}
    try on your machine
    explain this command
back to context overview