Imenu for go language!
go-mode.el use elisp, base regex.
go-imenu.el use go, base go’s package(ast/parse/token/format).
If you want to know more details, please click on the link above. I think go's package is simpler, faster, and more accurate than elisp's regular expression.
go get -u github.com/lukehoban/go-outline
Available on all major package.el
community maintained repos -
MELPA Stable and MELPA repos.
MELPA Stable is recommended as it has the latest stable version. MELPA has a development snapshot for users who don’t mind breakage but don’t want to run from a git checkout.
You can install go-imenu
using the following command:
M-x package-install [RET] go-imenu [RET]
or if you’d rather keep it in your dotfiles:
(unless (package-installed-p 'go-imenu)
(package-refresh-contents)
(package-install 'go-imenu))
If the installation doesn’t work try refreshing the package list:
M-x package-refresh-contents
Call go-imenu-setup function at go-mode-hook
(require 'go-imenu) ;; Don't need to require, if you install by package.el
(add-hook 'go-mode-hook 'go-imenu-setup)