summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--emacs.d/config/fcuny-go.el51
1 files changed, 30 insertions, 21 deletions
diff --git a/emacs.d/config/fcuny-go.el b/emacs.d/config/fcuny-go.el
index 14acbe4..dc0cd8b 100644
--- a/emacs.d/config/fcuny-go.el
+++ b/emacs.d/config/fcuny-go.el
@@ -3,33 +3,42 @@
 
 (use-package go-mode
   :ensure t
-  :init
-  (progn
-    (defun fcuny-go-set-tab-width ()
-      (setq-local tab-width 2))
-    (add-hook 'go-mode-hook 'fcuny-go-set-tab-width))
-
+  :after (company flycheck)
+  :preface
+  (defun fcuny/go-mode-setup ()
+    (add-hook 'go-mode-hook 'flycheck-mode)
+    (setq-default)
+    (setq tab-width 2))
   :config
-  (use-package go-eldoc
-    :config
-    (add-hook 'go-mode-hook 'go-eldoc-setup))
+  (add-hook 'go-mode-hook #'fcuny/go-mode-setup))
+
+(use-package go-eldoc
+  :after go-mode
+  :ensure t
+  :hook (go-mode . go-eldoc-setup))
 
-  (use-package gotest :ensure t)
+(use-package gotest
+  :ensure t)
 
-  (use-package go-guru :ensure t)
+(use-package go-guru
+  :ensure t)
 
-  (use-package go-imports :ensure t)
+(use-package go-imports
+  :ensure t)
 
-  (use-package golint :ensure t)
+(use-package golint
+  :ensure t)
 
-  (use-package go-projectile :ensure t)
+(use-package go-projectile
+  :ensure t)
 
-  (use-package company-go
-    :ensure t
-    :init
-    (progn
-      (setq company-go-show-annotation t))
-    :config
-    (add-hook 'go-mode-hook (lambda() (add-to-list 'company-backends 'company-go)))))
+(use-package company-go
+  :ensure t
+  :after (company go-mode)
+  :custom
+  (company-go-show-annotation t)
+  :config
+  (add-hook 'go-mode-hook 'company-mode)
+  (add-to-list 'company-backends 'company-go))
 
 (provide 'fcuny-go)