]> Cypherpunks repositories - gostls13.git/commitdiff
misc/emacs: find unused imports where path and package name differ
authorDominik Honnef <dominik.honnef@gmail.com>
Mon, 7 Oct 2013 17:08:26 +0000 (13:08 -0400)
committerAlan Donovan <adonovan@google.com>
Mon, 7 Oct 2013 17:08:26 +0000 (13:08 -0400)
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

misc/emacs/go-mode.el

index 02582756f370b2ce690ecdfb15418ff253589173..349b372ecfebe5528211e24b5924827679f966f0 100644 (file)
@@ -907,7 +907,7 @@ If IGNORE-CASE is non-nil, the comparison is case-insensitive."
   (reverse (remove nil
                    (mapcar
                     (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))
                               (string-to-number (match-string 2 line)))))
                     (split-string (shell-command-to-string
@@ -1107,7 +1107,7 @@ divisor for FILE-NAME."
   "Open a clone of the current buffer and overlay it with
 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
 for."
   (interactive)