To use, adapt the code in main.go for use in your project.
In addition to main.go, there's an example Makefile that
includes the secret sauce for making this trick work. If you're already
using package main for everything, the code should work as-is, but
you'll have to adapt it for more complex (read: sane) code layouts.
Enjoy!
P.S. Special thanks to @meatballhat by way of @syscomet for showing me this trick!
Have you been able to get
main.VersionStringto work in a namespaced project (i.e.github.com/modcloth-labs/mithril/main.VersionString)? If so, what's the magical incantation?