whompmacs/lib/thwap-go.el

16 lines
445 B
EmacsLisp
Raw Normal View History

2024-07-05 05:48:54 +00:00
2024-07-06 17:49:17 +00:00
(when thwap-dev-enable-go
(straight-use-package 'go-mode)
(straight-use-package 'eglot)
(setq lsp-go-analyses '((shadow . t)
(simplifycompositelit . :json-false)))
(when (executable-find "gopls")
(add-hook 'go-mode-hook #'lsp-deferred)
(add-hook 'go-mode-hook 'eglot-ensure))
(when (executable-find "goimports")
(setq gofmt-command "goimports"))
(add-hook 'before-save-hook 'gofmt-before-save))
(provide 'thwap-go)