go: reformat spacemacs/go-packages-gopkgs

Use setq instead of customize
Put spacemacs//go-set-tab-width in funcs.el
This commit is contained in:
syl20bnr 2018-06-09 00:43:52 -04:00
parent 938155c50a
commit 7951d763e3
2 changed files with 8 additions and 8 deletions

View File

@ -9,7 +9,11 @@
;;
;;; License: GPLv3
(defun load-gopath-file(gopath name)
(defun spacemacs//go-set-tab-width ()
"Set the tab width."
(setq-local tab-width go-tab-width))
(defun load-gopath-file (gopath name)
"Search for NAME file in all paths referenced in GOPATH."
(let* ((sep (if (spacemacs/system-is-mswindows) ";" ":"))
(paths (split-string gopath sep))
@ -73,6 +77,4 @@
(buffer-file-name (buffer-base-buffer)))))))
(defun spacemacs/go-packages-gopkgs ()
"Return a list of all Go packages, using `gopkgs'."
(sort
(process-lines "gopkgs")
#'string<))
(sort (process-lines "gopkgs") #'string<))

View File

@ -59,11 +59,9 @@
:defer t
:init
(progn
(defun spacemacs//go-set-tab-width ()
"Set the tab width."
(setq-local tab-width go-tab-width))
;; get go packages much faster
(setq 'go-packages-function 'spacemacs/go-packages-gopkgs)
(add-hook 'go-mode-hook 'spacemacs//go-set-tab-width))
(customize-set-variable 'go-packages-function 'spacemacs/go-packages-gopkgs)
:config
(progn
(add-hook 'before-save-hook 'gofmt-before-save)