Automatic Versioning of Go Code

6 months ago, I read a blog post from the Go package management team ( ) which asked for the community to build a tool which would automatically suggest the next version to use for Go code, so I decided to build something based on a simple algorithm:

To do it, I wrote some code to take in a path to remote git repository, clone it and use the experimental code to parse the Go code and extract features into a struct which defined the features:

It was then a case of creating a diff between versions and updating the version according to the rules.

So far so good, but then I needed to test it on a wide range of repositories.

Early feedback from the team was that it didn’t run in a Docker container, which actually turned out to be that the git log command I’d used contained an ISO 8601 compatible date format specifier, which wasn’t present in the older version of git that ships with the Go 1.7 Docker container, so once I’d changed that code to use a Unix timestamp instead, I had a container ready to set loose to version Go code.

The tool is up at - I just forgot to post about it earlier.

Maybe you might find it useful for determining whether your code or external code has broken binary compatibility.