 ;; http://tleyden.github.io/blog/2014/05/22/configure-emacs-as-a-go-editor-from-scratch
 ;; http://tleyden.github.io/blog/2014/05/27/configure-emacs-as-a-go-editor-from-scratch-part-2
 ;; http://dominik.honnef.co/posts/2013/03/writing_go_in_emacs
-(use-package company-go :ensure t)
-(add-hook 'go-mode-hook (lambda ()
-                          (helm-dash-activate-docset "Go")
-                          (setq-local company-backends '(company-go))
-                          (company-mode)
-                          (go-eldoc-setup)
-                          (setq tab-width 2 indent-tabs-mode 1)
-                          (add-hook 'before-save-hook #'gofmt-before-save)))
+(defun ar/go-mode-hook-function ()
+  "Called when entering `go-mode'."
+  (helm-dash-activate-docset "Go")
+  (setq-local company-backends '(company-go))
+  (company-mode)
+  (go-eldoc-setup)
+  (setq tab-width 2 indent-tabs-mode 1)
+  (add-hook 'before-save-hook #'gofmt-before-save))
+
+(use-package company-go :ensure t
+  :config
+  (add-hook 'go-mode-hook #'ar/go-mode-hook-function))
 
 (use-package golint :ensure t)
 


(defun ar/js-mode-hook-function ()
  "Called when entering `js-mode'."
  (setq company-tooltip-align-annotations t)
  (setq company-tern-meta-as-single-line t)
  (setq company-tern-property-marker "")
  (setq js-indent-level 2))

(add-hook 'js-mode-hook #'ar/js-mode-hook-function)


(use-package anaconda-mode :ensure t
  :commands (anaconda-mode))

(use-package company-anaconda :ensure t
  :after company)

(use-package python-docstring :ensure t
  :commands (python-docstring-mode))
