Next: Managing Imports, Up: Go-Mode Features [Index]
godoc
functionyou can invoke the identically named Go tool from within Emacs and read package documentation in a view-mode buffer. Additional feature: You can tab complete import paths.
gofmt
automatically formats your code to the one true coding style, used by every Go developer.
In Emacs, there are two ways to use gofmt
.
gofmt
manually with the identically named function gofmt
, which
will patch the current buffer according to gofmt
.
gofmt
every time you save a Go
buffer. Enabling that hook is as easy as doing:
(add-hook 'before-save-hook 'gofmt-before-save)
https://github.com/syohex/emacs-go-eldoc provides eldoc
functionality for go-mode
.