Subscribe to the Ardan Labs Insider

You’ll get our FREE Video Series & special offers on upcoming training events along with notifications on our latest blog posts.

Included in your subscription
  • Access to our free video previews
  • Updates on our latest blog posts
  • Discounts on upcoming events

Valid email required.

Submit failed. Try again or message us directly at

Thank You for Subscribing

Check your email for confirmation.

Write Your Go Programs Using GEdit

Author image
William Kennedy

This is a guest post from Tad Vizbaras from Etasoft in South Florida.

There are a number of editors and IDEs for Go development. LiteIde, Vim, Emacs and GEdit just to name a few. Each developer has their own favorite editor for each language they work with. Some like full featured IDE environments while others prefer speed over features. My personal favorite editors for Go development at the moment are Vim and GEdit.

GEdit comes as part of many Linux distros. If you use Ubuntu, it is part of the operating system. GEdit has some decent features like:

* Syntax Highlighting
* Split Windows
* Word Wrapping

Advanced features are left to be handled by external plug-ins.

I prefer project-less development. That means there are no formal project files and projects are preserved via a workspace bound to a directory structure. Go has excellent support for project-less development. When building and installing your projects, the Go tooling, in conjunction with the way Go packages code, can minimize the need for external scripts and makefiles.

GEdit is a decent editor but I could not find any good Plug-ins that would allow me to perform a Go build right from the editor. The "External Tools" Plug-in has worked for me. I was able to set up shortcuts and get "go build" to execute. When you click on errors, displayed in the bottom pane of GEdit, the cursor jumps to exact error location.

When I started programming in Go, the "External Tools" Plug-in worked for me for quite some time. But after awhile, I started to wish that "go build" would run similar to how Linters ran. With Linters, you can run a command after the file is saved. Since Go usually takes only few seconds to build, the Plug-in could execute a "go build" on save and then jump to the error location if there were any.

I wrote a GEdit Plug-in that is developed in Python. Depending on the version of Python you have installed, you may require some small adjustments. This is covered in the Known Issues section below.

Ops, I forgot to mention… Go is Awesome. But you probably already know that.

Meet GoBuild for GEdit 3.x
GoBuild - GEdit 3 Plug-in for Go (golang) development.

GoBuild Plug-in version 1.0 for GEdit. Plug-in attaches to the on_save event in GEdit for Go source code files only. It does nothing for any other file type.

It will run "go build" after the file is saved. If the current filename has "_test.go" in the name, then the Plug-in will run "go test" against the current file’s directory. The Plug-in will wait a number of seconds for the build or test to complete. It will timeout and quit the build or test so GEdit will not freeze.

Plug-in captures "go build" errors and shows them in the Gedit status bar. It also jumps to the first error and highlights error line if error is in the current file.

Screen Shot

Plug-in shows the last successful build.

Screen Shot

Plug-in shows any "go test" failures.

Screen Shot

I have posted the plugin on GitHub. Please send any feedback you may have.

Know Issues
Has been tested on Ubuntu 13.04 and 13.10.

Ubuntu 13.10 requires small change in the gobuild.plugin.
Line with python should be changed to python3 like below:


This is because Gedit seems to default on using python 3 instead of
python 2.7 on newer versions of Linux.

 * Simply drop files into ~/.local/share/gedit/plugins .
 * If this directory does not exist - create it.
 * Start GEdit
 * Open Edit-Preferences, then plug-ins and check "GoBuild after save" plug-in.

 * Current build directory is determined based on the active open source file.
 * Plug-in is designed for fast development on small to mid size projects.
 * Source code file is built with every save.
 * Tight iteration of the save-edit-save-edit cycle.
 * Not designed for large Go projects because compilation will timeout if it takes too long.
 * Not designed for Go unit tests that take a long time to run.
 * If you work on Go projects with build times over 5 seconds, this plug-in should be modified
    to use keyboard shortcut (such as ‘F5’) instead of on_save action.

Go Training

We have taught Go to thousands of developers all around the world since 2014. There is no other company that has been doing it longer and our material has proven to help jump start developers 6 to 12 months ahead of their knowledge of Go. We know what knowledge developers need in order to be productive and efficient when writing software in Go.

Our classes are perfect for both experienced and beginning engineers. We start every class from the beginning and get very detailed about the internals, mechanics, specification, guidelines, best practices and design philosophies. We cover a lot about "if performance matters" with a focus on mechanical sympathy, data oriented design, decoupling and writing production software.

Capital One
Red Ventures

Interested in Ultimate Go Corporate Training and special pricing?

Let’s Talk Corporate Training!

Join Our Online
Education Program

Our courses have been designed from training over 30,000 engineers since 2013, and they go beyond just being a language course. Our goal is to challenge every student to think about what they are doing and why.