buildinfo: document GitInfo

Change-Id: I1b62fd1b56de4ae9a9448886e4b2287a8dbae456
This commit is contained in:
mpl 2013-06-09 19:38:12 +02:00
parent 277795ad46
commit d32cfcc9cb
1 changed files with 5 additions and 1 deletions

View File

@ -1,10 +1,14 @@
package buildinfo
// GitInfo is either the empty string (the default)
// or is set to the git hash of the most recent commit
// using the -X linker flag. For example, it's set like:
// $ go install --ldflags="-X camlistore.org/pkg/buildinfo.GitInfo "`./misc/gitversion` camlistore.org/server/camlistored
var GitInfo string
func Version() string {
if GitInfo != "" {
return GitInfo
}
return "unknown" // TODO: show binary's date?
return "unknown"
}