doomemacs/modules/lang/go/README.org

34 lines
996 B
Org Mode
Raw Normal View History

* Go
Go support, including auto-completion, eldoc support (go-eldoc), REPL support,
refactoring commands, syntax-checking (flycheck), auto-formatting (gofmt) and
snippets (yasnippet).
+ [[https://golang.org][Homepage]]
2017-04-28 06:14:03 +08:00
+ [[https://github.com/hlissner/emacs-snippets/tree/master/go-mode][Snippets]]
+ [[../../feature/file-templates/templates/go-mode][File templates]]
** Installation
*** MacOS
2017-05-04 04:36:16 +08:00
#+BEGIN_SRC sh :tangle (if (doom-system-os 'macos) "yes")
brew install go
#+END_SRC
*** Arch Linux
2017-05-04 04:36:16 +08:00
#+BEGIN_SRC sh :dir /sudo:: :tangle (if (doom-system-os 'arch) "yes")
pacman --needed --noconfirm -S go
#+END_SRC
** Dependencies
2017-05-04 04:36:16 +08:00
You need to set up ~GOPATH~ before you can install lang/go's dependencies.
#+BEGIN_SRC sh
2017-05-04 04:36:16 +08:00
export GOPATH=~/work/go
go get -u github.com/nsf/gocode # completion
go get -u github.com/motemen/gore # REPL
go get -u golang.org/x/tools/cmd/guru # code navigation commands
go get -u golang.org/x/tools/cmd/gorename # refactoring commands
#+END_SRC