mirror of
https://github.com/golang/go
synced 2024-11-25 06:47:56 -07:00
Implement new emacs command M-x gofmt
Define a new interactive function in go-mode.el called gofmt. This function passes the current buffer through the external `gofmt` tool and replaces the buffer with the result. R=agl, rsc https://golang.org/cl/154044
This commit is contained in:
parent
022e3ae265
commit
c57054f7b4
@ -470,3 +470,9 @@ Useful for development work."
|
||||
(go-mode))
|
||||
|
||||
(provide 'go-mode)
|
||||
|
||||
(defun gofmt ()
|
||||
"Pipe the current buffer through the external tool `gofmt`."
|
||||
|
||||
(interactive)
|
||||
(shell-command-on-region 1 (+ (buffer-size) 1) "gofmt" t t shell-command-default-error-buffer))
|
||||
|
Loading…
Reference in New Issue
Block a user