-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add copyright notices
- Loading branch information
Showing
3 changed files
with
54 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// Copyright (c) 2018, The Decred developers | ||
// Copyright (c) 2017, The dcrdata developers | ||
// See LICENSE for details. | ||
|
||
package main | ||
|
||
import "fmt" | ||
|
||
type version struct { | ||
Major, Minor, Patch int | ||
Label string | ||
Nick string | ||
} | ||
|
||
var ver = version{ | ||
Major: 2, | ||
Minor: 0, | ||
Patch: 0, | ||
Label: ""} | ||
|
||
// CommitHash may be set on the build command line: | ||
// go build -ldflags "-X main.CommitHash=`git rev-parse --short HEAD`" | ||
var CommitHash string | ||
|
||
const appName string = "rebuilddb2" | ||
|
||
func (v *version) String() string { | ||
var hashStr string | ||
if CommitHash != "" { | ||
hashStr = "+" + CommitHash | ||
} | ||
if v.Label != "" { | ||
return fmt.Sprintf("%d.%d.%d-%s%s", | ||
v.Major, v.Minor, v.Patch, v.Label, hashStr) | ||
} | ||
return fmt.Sprintf("%d.%d.%d%s", | ||
v.Major, v.Minor, v.Patch, hashStr) | ||
} |