Skip to content

Commit 166dfb1

Browse files
committed
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.
1 parent 8db253d commit 166dfb1

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ the following extra features to provide an improved experience:
3232
`C-c C-f i`)
3333
- A function for adding imports, including tab completion
3434
(`go-import-add`, bound to `C-c C-a`)
35-
- A function for removing or commenting unused imports
36-
(`go-remove-unused-imports`)
3735
- It is recommended that you use `goimports` or the
3836
`organize-imports` feature of `gopls` to manage
3937
adding/removing/organizing imports automatically.

go-mode.el

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,6 @@ statements."
544544
["Jump to Definition" godef-jump t]
545545
"---"
546546
["Add Import" go-import-add t]
547-
["Remove Unused Imports" go-remove-unused-imports t]
548547
["Go to Imports" go-goto-imports t]
549548
"---"
550549
("Playground"
@@ -1739,7 +1738,6 @@ The following extra functions are defined:
17391738
- `gofmt'
17401739
- `godoc' and `godoc-at-point'
17411740
- `go-import-add'
1742-
- `go-remove-unused-imports'
17431741
- `go-goto-arguments'
17441742
- `go-goto-docstring'
17451743
- `go-goto-function'
@@ -2293,6 +2291,7 @@ If IGNORE-CASE is non-nil, the comparison is case-insensitive."
22932291
"Remove all unused imports.
22942292
If ARG is non-nil, unused imports will be commented, otherwise
22952293
they will be removed completely."
2294+
(declare (obsolete "set `gofmt-command' to goimports instead, or use LSP and gopls's \"Organize Imports\" code action." "1.7.0"))
22962295
(interactive "P")
22972296
(save-excursion
22982297
(let ((cur-buffer (current-buffer)) flymake-state lines)

0 commit comments

Comments
 (0)