doomemacs/modules/lang/go
marienz a17e06283e
bump: :lang go
mdempsky/gocode@4acdcbdea7 -> emacsattic/company-go@31948b463f

melpa/melpa@552d033e57 updated the recipe for company-go to pull from
emacsattic instead of mdempsky/gocode, which does not contain the commit
Doom pins company-go to.

Pin to the latest commit in the new repository instead, which is one
commit behind the previous repo (it does not have
mdempsky/gocode@f531cad262, but it looks like this does not matter for
Doom).

Ref melpa/melpa@552d033e57
2021-10-10 18:30:50 +02:00
..
autoload.el add benchmark bindings (,tbs and ,tba) 2020-02-09 10:58:49 +01:00
config.el General refactors & reformatting across the board 2020-06-04 20:13:28 -04:00
doctor.el replace go-add-tags with go-tag 2019-11-06 14:22:24 +01:00
packages.el bump: :lang go 2021-10-10 18:30:50 +02:00
README.org docs(go): update gore URL in README 2021-08-01 14:56:54 -04:00

lang/go

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

  • +lsp Enables integration for the gopls LSP server. It is highly recommended you use this, as the non-LSP experience is deprecated (and poor).

Plugins

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 get -u github.com/x-motemen/gore/cmd/gore
go get -u github.com/stamblerre/gocode
go get -u golang.org/x/tools/cmd/godoc
go get -u golang.org/x/tools/cmd/goimports
go get -u golang.org/x/tools/cmd/gorename
go get -u golang.org/x/tools/cmd/guru
go get -u github.com/cweill/gotests/...
go get -u github.com/fatih/gomodifytags
  • 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 Features

TODO Configuration

TODO Troubleshooting