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:
parent
938155c50a
commit
7951d763e3
|
@ -9,6 +9,10 @@
|
|||
;;
|
||||
;;; License: GPLv3
|
||||
|
||||
(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) ";" ":"))
|
||||
|
@ -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<))
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue