Set Go tab width to four rather than eight

This Emacs lisp makes the tabs in Go mode appear to be four spaces wide rather than the usual eight.

(defun my-go-setup ()
  (setq tab-width 4))
(add-hook 'go-mode-hook 'my-go-setup)


Copyright © Ben Bullock 2009-2024. All rights reserved. For comments, questions, and corrections, please email Ben Bullock ( or use the discussion group at Google Groups. / Privacy / Disclaimer