+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster startup; ~5-20% general boost + reduce consing, function calls & garbage collection by preferring cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and various cl-lib filter/map/reduce functions) -- where possible + prefer functions with dedicated opcodes, like assq (see byte-defop's in bytecomp.el for more) + prefer pcase & cond (faster) over cl-case + general refactor for code readability + ensure naming & style conventions are adhered to + appease byte-compiler by marking unused variables with underscore + defer minor mode activation to after-init, emacs-startup or window-setup hooks; a customization opportunity for users + ensures custom functionality won't interfere with startup. |
||
---|---|---|
.. | ||
autoload.el | ||
config.el | ||
packages.el | ||
README.org |
:lang go
This module adds 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
) - File templates
- Snippets
I have mixed feelings about Go. It's a decent compromise between C and higher-level languages. It's a pleasantly straight-forward language with elegant syntax, 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 & eldoc support)godoc
(for documentation lookup)goimports
(for auto-formatting code on save and fixing imports)gorename
(for extra refactoring commands)gore
(for the REPL)guru
(for code navigation & refactoring commands)
export GOPATH=~/work/go
go get -u github.com/motemen/gore
go get -u github.com/nsf/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