79 lines
2 KiB
Org Mode
79 lines
2 KiB
Org Mode
#+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~)
|
|
+ [[../../feature/file-templates/templates/go-mode][File templates]]
|
|
+ [[https://github.com/hlissner/emacs-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/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
|
|
|
|
** 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
|
|
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
|