Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/goPublic

Commit1bca937

Browse files
committed
[release-branch.go1.2] emacs: allow users to customize the gofmt command, in particular, to use goimports instead.
««« CL 23680043 / 341a490e4736emacs: allow users to customize the gofmt command, in particular, to use goimports instead.R=adonovanCC=golang-devhttps://golang.org/cl/23680043»»»R=golang-devCC=golang-devhttps://golang.org/cl/25740043
1 parent6ec8f31 commit1bca937

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎misc/emacs/go-mode.el‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ customize this variable to point to the wrapper script."
157157
:type'string
158158
:group'go)
159159

160+
(defcustomgofmt-command"gofmt"
161+
"The 'gofmt' command. Some users may replace this with 'goimports'
162+
from https://github.com/bradfitz/goimports."
163+
:type'string
164+
:group'go)
165+
160166
(deffacego-coverage-untracked
161167
'((t (:foreground"#505050")))
162168
"Coverage color of untracked code."
@@ -638,7 +644,7 @@ buffer."
638644
;; We're using errbuf for the mixed stdout and stderr output. This
639645
;; is not an issue because gofmt -w does not produce any stdout
640646
;; output in case of success.
641-
(if (zerop (call-process"gofmt"nil errbufnil"-w" tmpfile))
647+
(if (zerop (call-process gofmt-commandnil errbufnil"-w" tmpfile))
642648
(if (zerop (call-process-region (point-min) (point-max)"diff"nil patchbufnil"-n""-" tmpfile))
643649
(progn
644650
(kill-buffer errbuf)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp