Skip to content

Commit

Permalink
init-go: set eglot-workspace-configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
micanzhang committed Aug 7, 2023
1 parent aa1ada8 commit 719fcdc
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lisp/init-go.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
;;; golang configuration.
(require-package 'go-mode)

(defun set-default-goenv ()
(interactive)
(when (memq window-system '(mac ns))
Expand All @@ -22,6 +20,15 @@
(set (make-local-variable 'compile-command)
"go test -v"))
(setq tab-width 4)
(setq-default eglot-workspace-configuration
'((:gopls .
((staticcheck . t)
(usePlaceholders . t)
(env . ((GOFLAGS . "-tags=integration,smoke,smoketf")))
(analyses .
((unusedparams . t)
(unusedvariable . t)
(nilness . t)))))))
(local-set-key (kbd "C-c C-c") 'compile)
(local-set-key (kbd "C-c C-e") 'gorun)
(add-hook 'before-save-hook 'my-eglot-organize-imports nil t)
Expand All @@ -32,6 +39,7 @@
(interactive)
(shell-command (format "go run %s" (buffer-file-name))))


(provide 'init-go)
;; Local Variables:
;; version-control: never
Expand Down

0 comments on commit 719fcdc

Please sign in to comment.