2013-02-02 18:59:39 +00:00
|
|
|
package buildinfo
|
|
|
|
|
2013-06-09 17:38:12 +00:00
|
|
|
// 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
|
2013-02-02 18:59:39 +00:00
|
|
|
var GitInfo string
|
|
|
|
|
|
|
|
func Version() string {
|
|
|
|
if GitInfo != "" {
|
|
|
|
return GitInfo
|
|
|
|
}
|
2013-06-09 17:38:12 +00:00
|
|
|
return "unknown"
|
2013-02-02 18:59:39 +00:00
|
|
|
}
|