Forrest logo
back to context overview

goimports

List of commands for goimports:

  • goimports:tldr:61d68 goimports: Display the completed import source file.
    $ goimports ${filename}.go
    try on your machine
    explain this command
  • goimports:tldr:7c46e goimports: Write the result back to the source file instead of the standard output.
    $ goimports -w ${filename}.go
    try on your machine
    explain this command
  • goimports:tldr:caf42 goimports: Set the import prefix string after 3rd-party packages (comma-separated list).
    $ goimports -local ${path-to-package} ${filename}.go
    try on your machine
    explain this command
  • goimports:tldr:db2e6 goimports: Display diffs and write the result back to the source file.
    $ goimports -w -d ${filename}.go
    try on your machine
    explain this command
back to context overview