Remove timestamp from version command

This enables reproducible builds, for details see
https://reproducible-builds.org/docs/timestamps/
This commit is contained in:
Alexander Neumann
2016-12-19 21:14:12 +01:00
parent 98237bf942
commit 166d1811a1
3 changed files with 3 additions and 8 deletions

View File

@@ -12,7 +12,6 @@ import (
"path/filepath"
"runtime"
"strings"
"time"
)
var (
@@ -33,8 +32,6 @@ var config = struct {
Tests: []string{"restic/...", "cmds/..."}, // tests to run
}
const timeFormat = "2006-01-02 15:04:05"
// specialDir returns true if the file begins with a special character ('.' or '_').
func specialDir(name string) bool {
if name == "." {
@@ -392,8 +389,7 @@ func main() {
output := filepath.Join(cwd, outputFilename)
version := getVersion()
compileTime := time.Now().Format(timeFormat)
constants := Constants{`main.compiledAt`: compileTime}
constants := Constants{}
if version != "" {
constants["main.version"] = version
}