Skip to content

Instantly share code, notes, and snippets.

@lstoll
Forked from lclarkmichalek/gist:1657284
Created April 18, 2012 06:41
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lstoll/2411499 to your computer and use it in GitHub Desktop.
Save lstoll/2411499 to your computer and use it in GitHub Desktop.
Flymake mode for golang
(require 'flymake)
(defun flymake-go-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "go" (list "build" "-o" "/dev/null" temp-file))))
(push '(".+\\.go$" flymake-go-init) flymake-allowed-file-name-masks)
(add-hook 'go-mode-hook 'flymake-mode)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment