emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/go-mode 965dcbc 393/495: Use file name, not directory, wi


From: ELPA Syncer
Subject: [nongnu] elpa/go-mode 965dcbc 393/495: Use file name, not directory, with -srcdir flag
Date: Sat, 7 Aug 2021 09:05:55 -0400 (EDT)

branch: elpa/go-mode
commit 965dcbc5eb06d73cb700724535dd449a00082b84
Author: Dominik Honnef <dominik@honnef.co>
Commit: Dominik Honnef <dominik@honnef.co>

    Use file name, not directory, with -srcdir flag
    
    goimports accepts a full file name for srcdir, and requires it for some
    of its features.
    
    Closes gh-146
---
 go-mode.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/go-mode.el b/go-mode.el
index cc6422b..b2a8bd0 100644
--- a/go-mode.el
+++ b/go-mode.el
@@ -1152,7 +1152,11 @@ with goflymake \(see URL 
`https://github.com/dougm/goflymake'), gocode
           (when (and (gofmt--is-goimports-p) buffer-file-name)
             (setq our-gofmt-args
                   (append our-gofmt-args
-                          (list "-srcdir" (file-name-directory (file-truename 
buffer-file-name))))))
+                          ;; srcdir, despite its name, supports
+                          ;; accepting a full path, and some features
+                          ;; of goimports rely on knowing the full
+                          ;; name.
+                          (list "-srcdir" (file-truename buffer-file-name)))))
           (setq our-gofmt-args (append our-gofmt-args
                                        gofmt-args
                                        (list "-w" tmpfile)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]