mirror of
https://github.com/doomemacs/doomemacs.git
synced 2025-12-06 02:30:33 -08:00
To ensure lsp/eglot settings have precedence over local servers (e.g. cider and lookup handlers). Ref: clojure-emacs/cider#3170 |
||
|---|---|---|
| .. | ||
| autoload.el | ||
| config.el | ||
| doctor.el | ||
| packages.el | ||
| README.org | ||
lang/go
Table of Contents TOC
Description
This module adds Go support, with optional (but recommended) LSP support via gopls.
- Code completion (
gocode) - Documentation lookup (
godoc) - Eldoc support (
go-eldoc) - REPL (
gore) - Syntax-checking (
flycheck) - Auto-formatting on save (
gofmt) (requires:editor (format +onsave)) - Code navigation & refactoring (
go-guru) - File templates
- Snippets
- Generate testing code (
go-gen-test) - Code checking (
flycheck-golangci-lint)
Module Flags
+lspEnables integration for the gopls LSP server. It is highly recommended you use this, as the non-LSP experience is deprecated (and poor).
Plugins
- go-mode
- go-eldoc
- go-guru
- gorepl-mode
- go-tag
- company-go*
DEPRECATED - go-gen-test
- flycheck-golangci-lint (if
:checkers syntaxis enabled)
Prerequisites
Go
To get started with Go, you need the go tool:
MacOS
brew install go
Arch Linux
sudo pacman -S go
openSUSE
sudo zypper install go
Dependencies
This module requires a valid GOPATH, and the following Go packages:
gocode(for code completion & eldoc support)godoc(for documentation lookup)gorename(for extra refactoring commands)gore(for the REPL)guru(for code navigation & refactoring commands)goimports(optional: for auto-formatting code on save & fixing imports)gotests(for generate test code)gomodifytags(for manipulating tags)
export GOPATH=~/work/go
go install github.com/x-motemen/gore/cmd/gore@latest
go install github.com/stamblerre/gocode@latest
go install golang.org/x/tools/cmd/godoc@latest
go install golang.org/x/tools/cmd/goimports@latest
go install golang.org/x/tools/cmd/gorename@latest
go install golang.org/x/tools/cmd/guru@latest
go install github.com/cweill/gotests/gotests@latest
go install github.com/fatih/gomodifytags@latest
golangci-lint(optional: for flycheck to integrate golangci-lint results) it is recommended to not usego getto install this one, check the documentation.