It appears to me that go-mode and speedbar are not working together - the .go files do not appear in the file list.

https://github.com/dominikh/go-mode.el/issues/270 is a bug on go-mode which suggests that it isn't just me seeing this problem.

What is required to change this?

1 Answer 1


Looks like adding

(speedbar-add-supported-extension ".go")

Might be a big part of the solution.

  • Can you elaborate, explaining how/why this helps?
    – Drew
    Mar 21, 2019 at 1:17
  • The function adds the file extension to the speedbar-supported-extension-expressions user-option. The ".go" file extension could also be added directly to the user-option in the customization buffer. The list is used to build speedbar-file-regexp which is used inside Speedbar.el to detect the files of interest. This works when go-mode is installed.
    – PRouleau
    Jan 23, 2021 at 4:03
  • Ideally the code for the major mode should evaluate the (speedbar-add-supported-extension ".go") form to add speedbar support. When that's not done, the choice is to add the extension support to the customizable user-option or to place this code somewhere, like the Emacs init code.
    – PRouleau
    Jan 23, 2021 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.