Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
69 lines (57 sloc) 2.03 KB
(use-package go-mode
:mode ("\\.go\\'" . go-mode)
((goimports . "go get -u")
(godef . "go get -u"))
(setq gofmt-command "goimports"
indent-tabs-mode t)
(add-hook 'before-save-hook 'gofmt-before-save)
:bind (:map go-mode-map
("C-c C-c" . compile)
("C-c C-g" . go-goto-imports)
("C-c C-k" . godoc)
("M-." . godef-jump)))
(use-package go-eldoc
:ensure-system-package (gocode . "go get -u")
:config (add-hook 'go-mode-hook 'go-eldoc-setup))
(use-package company-go
:after company
:ensure-system-package (gocode . "go get -u")
(add-hook 'go-mode-hook (lambda ()
(set (make-local-variable 'company-backends) '(company-go))
(use-package go-errcheck
:after go-mode
:ensure-system-package (errcheck . "go get -u")
:bind (:map go-mode-map
("C-c C-e" . go-errcheck)))
(use-package go-imenu
:ensure-system-package (go-outline . "go get -u")
:after go-mode
(add-hook 'go-mode-hook 'go-imenu-setup))
(use-package gotest
:after go-mode
:bind (:map go-mode-map
("C-c C-f" . go-test-current-file)
("C-c C-t" . go-test-current-test)
("C-c C-p" . go-test-current-project)
("C-c C-b" . go-test-current-benchmark)
("C-x x" . go-run)))
(use-package go-playground
:after go-mode
(setq go-playground-basedir "~/code/go/src/playground")
(my/global-map-and-set-key "C-R" 'go-playground-exec)
(use-package go-rename
:after go-mode
:ensure-system-package (gorename . "go get -u")
:bind (:map go-mode-map
("C-c C-r" . go-rename)
You can’t perform that action at this time.