#+TITLE: lang/go #+DATE: January 16, 2017 #+SINCE: v2.0 #+STARTUP: inlineimages * Table of Contents :TOC: - [[#description][Description]] - [[#module-flags][Module Flags]] - [[#plugins][Plugins]] - [[#prerequisites][Prerequisites]] - [[#go][Go]] - [[#dependencies][Dependencies]] - [[#features][Features]] - [[#configuration][Configuration]] - [[#troubleshooting][Troubleshooting]] * Description This module adds [[https://golang.org][Go]] support. + Code completion (~gocode~) + Documentation lookup (~godoc~) + Eldoc support (~go-eldoc~) + REPL (~gore~) + Syntax-checking (~flycheck~) + Auto-formatting on save (~gofmt~) + Code navigation & refactoring (~go-guru~) + [[../../editor/file-templates/templates/go-mode][File templates]] + [[https://github.com/hlissner/doom-snippets/tree/master/go-mode][Snippets]] ** Module Flags This module provides no flags. ** Plugins + [[https://github.com/dominikh/go-mode.el][go-mode]] + [[https://github.com/syohex/emacs-go-eldoc][go-eldoc]] + [[https://github.com/dominikh/go-mode.el][go-guru]] + [[https://github.com/manute/gorepl-mode][gorepl-mode]] + [[https://github.com/syohex/emacs-go-add-tags][go-add-tags]] + [[https://github.com/mdempsky/gocode][company-go]]* * Prerequisites ** Go To get started with Go, you need the ~go~ tool: *** MacOS #+BEGIN_SRC bash brew install go #+END_SRC *** Arch Linux #+BEGIN_SRC bash sudo pacman -S go #+END_SRC *** openSUSE #+BEGIN_SRC sh :dir /sudo:: sudo zypper install go #+END_SRC ** 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) #+BEGIN_SRC sh export GOPATH=~/work/go go get -u github.com/motemen/gore/cmd/gore go get -u github.com/mdempsky/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 #+END_SRC * TODO Features * TODO Configuration * TODO Troubleshooting