| gopls [flags] fix [fix-flags] <filename> |
| Example: apply fixes to this file, rewriting it: |
| $ gopls fix -a -w internal/cmd/check.go |
| The -a (-all) flag causes all fixes, not just preferred ones, to be |
| applied, but since no fixes are currently preferred, this flag is |
| Arguments after the filename are interpreted as LSP CodeAction kinds |
| to be applied; the default set is {"quickfix"}, but valid kinds include: |
| CodeAction kinds are hierarchical, so "refactor" includes |
| "refactor.inline". There is currently no way to enable or even |
| Example: apply any "refactor.rewrite" fixes at the specific byte |
| $ gopls fix -a internal/cmd/check.go:#43 refactor.rewrite |
| apply all fixes, not just preferred fixes |
| display diffs instead of edited file content |
| display names of edited files |
| with -write, make copies of original files |
| write edited content to source files |