Permalink
Browse files

Make go-mode use spaces instead of tabs for indentation

  • Loading branch information...
1 parent 781b9a5 commit 190f1b30cd37e41e4617d366c9cdfcf6fa3cc781 @ghoseb committed Oct 7, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/go-mode.el
View
@@ -484,7 +484,7 @@ functions, and some types. It also provides indentation that is
(set (make-local-variable 'comment-end) "")
;; Go style
- (setq indent-tabs-mode t))
+ (setq indent-tabs-mode nil))
;;;###autoload
(add-to-list 'auto-mode-alist (cons "\\.go$" #'go-mode))
@@ -515,7 +515,7 @@ Replace the current buffer on success; display errors on failure."
(save-restriction
(let (deactivate-mark)
(widen)
- (if (= 0 (shell-command-on-region (point-min) (point-max) "gofmt"
+ (if (= 0 (shell-command-on-region (point-min) (point-max) "gofmt -spaces=true -tabwidth=4 -tabindent=false"
outbuf nil errbuf))
;; gofmt succeeded: replace the current buffer with outbuf,
;; restore the mark and point, and discard errbuf.

0 comments on commit 190f1b3

Please sign in to comment.