mirror of https://github.com/perkeep/perkeep.git
buildinfo: document GitInfo
Change-Id: I1b62fd1b56de4ae9a9448886e4b2287a8dbae456
This commit is contained in:
parent
277795ad46
commit
d32cfcc9cb
|
@ -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"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue