Notes task for go apps


Very simple — I need a tool to control annotations in my code. I love annotations and think that with good practices they are very useful.

How to use annotations? Very simple, every time you work on some part of a code, and don’t have time to improve it but really want to do that in the nearest future, you drop a comment with a keyword what you think needs to be done here.

Classical annotations are TODO, FIXME, and OPTIMISE, also people love to use BUG and BAD SMELL ones.

RubyOnRails has a cool cli rake task it calls “rake notes”(or rails notes). It scans the source code and prints the comments with annotations. I was using that a lot back in time and was really missing same in GoLang, so I decided to build one myself. And here you go, 1 hour of work, and voila

Installations and usage

To get go-notes just run:

go get -u

It will fetch the code and automatically build it with your current golang version and place it into your bin directory, so you can access it from any folder.


Usage: go-notes [flags] <Go file or directory> ...
Without options generates all the note types. Defaults are:
  // FIXME    - call to fix something
// OPTIMIZE - call for a refactoring
// TODO - future plans
-f - FIXME annotations
-o - OPTIMIZE annotations
-t - TODO annotations
-c CUSTOM - custom annotation lable
-format count - output format aggregated counts
-format list - output format list with files and annotations (default)

Jenkins integration with plotting

At our company, we use JenkinsCI for internal projects so it would be nice to integrate go-notes with this CI and plot amount of annotations from branch to branch so we can visually control it.

We will use plugin.

Last release of go-notes(since v0.0.3) supports format key so you can define output as CSV with annotation types as a header and counts as a first line. So it will look something like:


This format you can perfectly use with Plot plugin to get a graph like this:

Future Improvements

I was also thinking about Github badge with amount of annotations. Same as GoReport or Travic-CI build status. Some thing like:


So users will be able to have visual control over a number of annotations. I really like the idea behind the service. You can see the code in

Annotations over some repositories

I did a bit of scanning over the packages and tools i use every day, here are some results:

Follow me on Twitter( for more articles/news/updates about Go programming language.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.