forked from ethersphere/bee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
version.go
33 lines (28 loc) · 861 Bytes
/
version.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2020 The Swarm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package bee
import (
"strconv"
"time"
)
var (
version = "1.6.1" // manually set semantic version number
commitHash string // automatically set git commit hash
commitTime string // automatically set git commit time
Version = func() string {
if commitHash != "" {
return version + "-" + commitHash
}
return version + "-dev"
}()
// CommitTime returns the time of the commit from which this code was derived.
// If it's not set (in the case of running the code directly without compilation)
// then the current time will be returned.
CommitTime = func() string {
if commitTime == "" {
commitTime = strconv.Itoa(int(time.Now().Unix()))
}
return commitTime
}
)