branch: elpa/go-mode commit 166dfb1e090233c4609a50c2ec9f57f113c1da72 Author: Dominik Honnef <domi...@honnef.co> Commit: Dominik Honnef <domi...@honnef.co>
Deprecate go-remove-unused-imports Most people use goimports or LSP, which provide more robust alternatives to parsing compiler errors. In fact, the function doesn't work for newer versions of Go because the format of the error has changed. --- README.md | 2 -- go-mode.el | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index e8f985237c..25fec17c2f 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,6 @@ the following extra features to provide an improved experience: `C-c C-f i`) - A function for adding imports, including tab completion (`go-import-add`, bound to `C-c C-a`) - - A function for removing or commenting unused imports - (`go-remove-unused-imports`) - It is recommended that you use `goimports` or the `organize-imports` feature of `gopls` to manage adding/removing/organizing imports automatically. diff --git a/go-mode.el b/go-mode.el index 0a8b7c5499..c41a94aa1d 100644 --- a/go-mode.el +++ b/go-mode.el @@ -544,7 +544,6 @@ statements." ["Jump to Definition" godef-jump t] "---" ["Add Import" go-import-add t] - ["Remove Unused Imports" go-remove-unused-imports t] ["Go to Imports" go-goto-imports t] "---" ("Playground" @@ -1739,7 +1738,6 @@ The following extra functions are defined: - `gofmt' - `godoc' and `godoc-at-point' - `go-import-add' -- `go-remove-unused-imports' - `go-goto-arguments' - `go-goto-docstring' - `go-goto-function' @@ -2293,6 +2291,7 @@ If IGNORE-CASE is non-nil, the comparison is case-insensitive." "Remove all unused imports. If ARG is non-nil, unused imports will be commented, otherwise they will be removed completely." + (declare (obsolete "set `gofmt-command' to goimports instead, or use LSP and gopls's \"Organize Imports\" code action." "1.7.0")) (interactive "P") (save-excursion (let ((cur-buffer (current-buffer)) flymake-state lines)