summary refs log tree commit diff
path: root/emacs.d/custom/fcuny-go.el
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--emacs.d/custom/fcuny-go.el13
1 files changed, 13 insertions, 0 deletions
diff --git a/emacs.d/custom/fcuny-go.el b/emacs.d/custom/fcuny-go.el
new file mode 100644
index 0000000..3926c9e
--- /dev/null
+++ b/emacs.d/custom/fcuny-go.el
@@ -0,0 +1,13 @@
+(use-package go-mode
+  :ensure t
+  :after (exec-path-from-shell)
+  :hook (go-mode . fcuny/go-mode-setup)
+  :init
+  (defun fcuny/go-mode-setup ()
+    (setq tab-width 4)
+    (add-hook 'before-save-hook 'gofmt-before-save))
+  :config
+  (when (memq window-system '(mac ns))
+    (exec-path-from-shell-copy-env "GOPATH")))
+
+(provide 'fcuny-go)