doomemacs/modules/lang/go
Henrik Lissner 1abcf913aa
revert: fix(docs): set mode in file-local vars
emacs-straight/org-mode@e22b4eb7aa introduced a breaking change that
made it impossible to rely on .dir-locals.el to change org-mode buffers
in $EMACSDIR to doom-docs-org-mode (without infinite recursion), so we
used file-local variables in 7e400ab.

emacs-straight/org-mode@215de6176b reverted that change, so we can use
.dir-locals.el again, and this is my preference, since it requires less
boilerplate across our hundreds of org files.

Ref: emacs-straight/org-mode@215de6176b
Ref: emacs-straight/org-mode@e22b4eb7aa
Revert: 7e400abdc0
2022-08-07 19:08:07 +02:00
..
autoload.el feat(go): add test-file function and keybinding 2022-08-04 17:42:21 +02:00
config.el feat(go): add test-file function and keybinding 2022-08-04 17:42:21 +02:00
doctor.el docs(tree-sitter): add doctor checks for flag 2022-05-22 21:26:00 +01:00
packages.el bump: :lang 2022-03-31 21:09:38 +02:00
README.org revert: fix(docs): set mode in file-local vars 2022-08-07 19:08:07 +02:00

:lang go

Description   unfold

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)

Maintainers

This module needs a maintainer. Become a maintainer?

Module flags

+lsp
Enable LSP support for go-mode. Requires :tools lsp and a langserver (supports gopls). Highly recommended, as the non-LSP experience is deprecated (and poor).
+tree-sitter
Leverages tree-sitter for better syntax highlighting and structural text editing. Requires :tools tree-sitter.

Hacks

No hacks documented for this module.

TODO Changelog

This module does not have a changelog yet.

Installation

Enable this module in your doom! block.

This module requires Go, a valid $GOPATH, and a number of go packages, listed below.

Go

  • macOS: $ brew install go
  • Arch Linux: $ pacman -S go
  • openSUSE: $ zypper install go

Dependencies

  • 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 use $ go get to install this one, check the documentation.

TODO Usage

🔨 This module has no usage documentation yet. Write some?

TODO Configuration

🔨 This module has no configuration documentation yet. Write some?

Troubleshooting

There are no known problems with this module. Report one?

Frequently asked questions

This module has no FAQs yet. Ask one?

TODO Appendix

🔨 This module has no appendix yet. Write one?