Skip to content

Instantly share code, notes, and snippets.

@pivaldi
Created July 16, 2024 22:05
Show Gist options
  • Save pivaldi/ba31b3c28fcf8264b38b2ea982e436f3 to your computer and use it in GitHub Desktop.
Save pivaldi/ba31b3c28fcf8264b38b2ea982e436f3 to your computer and use it in GitHub Desktop.
Emacs Project Local Variables for Go developer to Configure lsp-go-build-flags and flycheck-golangci-lint-config
;;; Put this file in the root directory of your Go project
;;; For more information see (info "(emacs) Directory Variables")
;;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html
((nil . ((eval . (setq local_project_root_path
(projectile-project-root))
)))
(go-mode . ((eval . (set (make-local-variable 'flycheck-golangci-lint-config) (concat local_project_root_path ".golangci.yml")))
(subdirs . true)))
(go-mode . ((eval . (set (make-local-variable 'lsp-go-build-flags) (vector "-tags=no_pprof")))
(subdirs . true)))
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment