Improve go usage

This commit is contained in:
nemunaire 2021-04-30 12:22:58 +02:00
commit af7c179407
3 changed files with 2124 additions and 2 deletions

View file

@ -26,3 +26,20 @@
(add-hook 'ruby-mode-hook
(lambda ()
(insert-shebang-if-empty "/usr/bin/ruby")))
; Golang
(add-hook 'go-mode-hook
(lambda ()
(set (make-local-variable 'compile-command) "go build")))
(add-hook 'go-mode-hook
(lambda ()
(when (buffer-empty-p)
(save-excursion
(goto-char (point-min))
(insert "package \n\nimport (\n\t\n)\n")))))
(add-hook 'before-save-hook 'gofmt-before-save)
(eval-after-load "go-mode"
'(require 'flymake-go))