Skip to content

Instantly share code, notes, and snippets.

@lclarkmichalek
Created January 22, 2012 14:52
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save lclarkmichalek/1657284 to your computer and use it in GitHub Desktop.
Save lclarkmichalek/1657284 to your computer and use it in GitHub Desktop.
Flymake mode for golang
(require 'flymake)
(defvar go-compiler "8g")
(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-compiler (list "-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