This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
spacemacs/layers/+lang/go/packages.el

52 lines
1.3 KiB
EmacsLisp
Raw Normal View History

(setq go-packages
2015-01-09 06:08:07 +00:00
'(
company
2015-04-01 02:24:01 +00:00
company-go
flycheck
2015-01-09 06:08:07 +00:00
go-mode
go-eldoc
))
2015-01-09 06:08:07 +00:00
(defun go/post-init-flycheck ()
(spacemacs/add-flycheck-hook 'go-mode))
2015-01-09 06:08:07 +00:00
(defun go/init-go-mode()
(when (memq window-system '(mac ns x))
(exec-path-from-shell-copy-env "GOPATH"))
2015-01-09 06:08:07 +00:00
(use-package go-mode
:defer t
:config
(progn
(add-hook 'before-save-hook 'gofmt-before-save)
(defun spacemacs/go-run-package-tests ()
(interactive)
(shell-command "go test"))
(evil-leader/set-key-for-mode 'go-mode
"mhh" 'godoc-at-point
"mig" 'go-goto-imports
"mia" 'go-import-add
"mir" 'go-remove-unused-imports
"meb" 'go-play-buffer
"mer" 'go-play-region
"med" 'go-download-play
"mga" 'ff-find-other-file
"mgg" 'godef-jump
"mtp" 'spacemacs/go-run-package-tests))))
(defun go/init-go-eldoc()
(add-hook 'go-mode-hook 'go-eldoc-setup))
(when (configuration-layer/layer-usedp 'auto-completion)
(defun go/post-init-company ()
(spacemacs|add-company-hook go-mode))
(defun go/init-company-go ()
(use-package company-go
:if (configuration-layer/package-usedp 'company)
:defer t
:init
2015-04-30 03:54:30 +00:00
(push 'company-go company-backends-go-mode))))