Commit 989a63eb authored by Dominik Honnef's avatar Dominik Honnef Committed by Alan Donovan

misc/emacs: find unused imports where path and package name differ

The Go compiler emits extra information for this case:

imported and not used: "sandbox/foo_bar" as bar

R=adonovan
CC=golang-dev
https://golang.org/cl/14111043
parent fc1bea32
...@@ -907,7 +907,7 @@ If IGNORE-CASE is non-nil, the comparison is case-insensitive." ...@@ -907,7 +907,7 @@ If IGNORE-CASE is non-nil, the comparison is case-insensitive."
(reverse (remove nil (reverse (remove nil
(mapcar (mapcar
(lambda (line) (lambda (line)
(if (string-match "^\\(.+\\):\\([[:digit:]]+\\): imported and not used: \".+\"$" line) (if (string-match "^\\(.+\\):\\([[:digit:]]+\\): imported and not used: \".+\".*$" line)
(if (string= (file-truename (match-string 1 line)) (file-truename buffer-file-name)) (if (string= (file-truename (match-string 1 line)) (file-truename buffer-file-name))
(string-to-number (match-string 2 line))))) (string-to-number (match-string 2 line)))))
(split-string (shell-command-to-string (split-string (shell-command-to-string
...@@ -1107,7 +1107,7 @@ divisor for FILE-NAME." ...@@ -1107,7 +1107,7 @@ divisor for FILE-NAME."
"Open a clone of the current buffer and overlay it with "Open a clone of the current buffer and overlay it with
coverage information gathered via go test -coverprofile=COVERAGE-FILE. coverage information gathered via go test -coverprofile=COVERAGE-FILE.
If COVERAGE-FILE is nil, it will either be infered from the If COVERAGE-FILE is nil, it will either be inferred from the
current buffer if it's already a coverage buffer, or be prompted current buffer if it's already a coverage buffer, or be prompted
for." for."
(interactive) (interactive)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment