doomemacs/modules/lang/go/README.org
2017-05-25 20:09:12 +02:00

1.6 KiB

:lang go

This module adds Go support.

  • Code completion (gocode)
  • eldoc support (go-eldoc)
  • REPL (gore)
  • Syntax-checking (flycheck)
  • Auto-formatting on save (gofmt)
  • Code navigation & refactoring (go-guru)
  • File templates
  • Snippets

I have mixed feelings about Go. It's a decent compromise between C and higher-level languages. I like its simplicity and syntax (mostly), but it lacks native support for certain luxuries I miss from other languages, like generics, optional arguments, and function overloading. You've got to learn to love interface{}.

Still, Go has been a remarkably useful (and fast!) companion for a variety of small-to-medium backend web and CLI projects.

Install

To get started with Go, you need the go tool:

MacOS

brew install go

Arch Linux

sudo pacman --needed --noconfirm -S go

Dependencies

This module requires a valid GOPATH, and the following Go packages:

  • gocode (for code completion)
  • gore (for the REPL)
  • guru (for code navigation & refactoring commands)
  • gorename (for extra refactoring commands)
export GOPATH=~/work/go

go get -u github.com/nsf/gocode
go get -u github.com/motemen/gore
go get -u golang.org/x/tools/cmd/guru
go get -u golang.org/x/tools/cmd/gorename