github.com/powerman/golang-tools@v0.1.11-0.20220410185822-5ad214d8d803/internal/lsp/cmd/usage/format.hlp (about)

     1  format the code according to the go standard
     2  
     3  Usage:
     4    gopls [flags] format [format-flags] <filerange>
     5  
     6  The arguments supplied may be simple file names, or ranges within files.
     7  
     8  Example: reformat this file:
     9  
    10  	$ gopls format -w internal/lsp/cmd/check.go
    11  
    12  format-flags:
    13    -d,-diff
    14      	display diffs instead of rewriting files
    15    -l,-list
    16      	list files whose formatting differs from gofmt's
    17    -w,-write
    18      	write result to (source) file instead of stdout