(use-package go-mode :ensure t :after (exec-path-from-shell flycheck flyspell company company-go hydra) :hook ((go-mode . fcuny/go-mode-setup) (go-mode . company-mode)) :custom (godoc-use-completing-read t) (gofmt-command "goimports") ;; see https://github.com/dominikh/go-mode.el/issues/262 (godoc-at-point-function 'godoc-gogetdoc) :init (defun fcuny/go-mode-setup () (setq tab-width 4) (setq comment-auto-fill-only-comments t) (setq fill-column 80) (auto-fill-mode 1) (add-hook 'before-save-hook 'gofmt-before-save)) :config (when (memq window-system '(mac ns)) (exec-path-from-shell-copy-env "GOPATH"))) (use-package gotest :ensure t :after go-mode) (provide 'fcuny-go)