Description: Add version info using linker flags.
--- a/mongodb_exporter.go
+++ b/mongodb_exporter.go
@@ -11,6 +11,7 @@
 
 	"github.com/dcu/mongodb_exporter/collector"
 	"github.com/dcu/mongodb_exporter/shared"
+	"github.com/dcu/mongodb_exporter/version"
 
 	"github.com/golang/glog"
 	"github.com/prometheus/client_golang/prometheus"
@@ -57,7 +58,7 @@
 	mongodbCollectCollectionMetrics     = flag.Bool("mongodb.collect.collection", false, "Collect MongoDB collection metrics")
 	mongodbCollectProfileMetrics        = flag.Bool("mongodb.collect.profile", false, "Collect MongoDB profile metrics")
 	mongodbCollectConnPoolStats         = flag.Bool("mongodb.collect.connpoolstats", false, "Collect MongoDB connpoolstats")
-	version                             = flag.Bool("version", false, "Print mongodb_exporter version")
+	showVersion                         = flag.Bool("version", false, "Print mongodb_exporter version")
 )
 
 type basicAuthHandler struct {
@@ -180,8 +181,8 @@
 
 func main() {
 	flag.Parse()
-	if *version {
-		fmt.Println("mongodb_exporter version: {{VERSION}}")
+	if *showVersion {
+		fmt.Printf("mongodb_exporter version: %s\n", version.Version)
 		return
 	}
 	shared.ParseEnabledGroups(*enabledGroupsFlag)
--- /dev/null
+++ b/version/info.go
@@ -0,0 +1,6 @@
+package version
+
+// Build information. Populated at build-time.
+var (
+	Version   string
+)
