Code Review
/
govpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Optimize socketclient adapter and add various code improvements
[govpp.git]
/
version
/
version.go
diff --git
a/version/version.go
b/version/version.go
index
eb8063a
..
8bde72c
100644
(file)
--- a/
version/version.go
+++ b/
version/version.go
@@
-21,14
+21,17
@@
import (
"time"
)
"time"
)
+// Following variables should normally be updated via `-ldflags "-X ..."`.
+// However, the version string is hard-coded to ensure it is always included
+// even with bare go build/install.
var (
var (
- name
= "govpp"
- version
= "v0.3.5
"
- commit
Hash
= "unknown"
- b
uildBranch
= "HEAD"
- buildStamp
= ""
- buildUser
= ""
- buildHost
= ""
+ name = "govpp"
+ version
= "v0.4.0-dev
"
+ commit
= "unknown"
+ b
ranch
= "HEAD"
+ buildStamp = ""
+ buildUser = ""
+ buildHost = ""
buildDate time.Time
)
buildDate time.Time
)
@@
-41,6
+44,10
@@
func init() {
buildDate = time.Unix(buildstampInt64, 0)
}
buildDate = time.Unix(buildstampInt64, 0)
}
+func Version() string {
+ return version
+}
+
func Info() string {
return fmt.Sprintf(`%s %s`, name, version)
}
func Info() string {
return fmt.Sprintf(`%s %s`, name, version)
}
@@
-54,7
+61,7
@@
func Verbose() string {
Build date: %s
Go runtime: %s (%s/%s)`,
name,
Build date: %s
Go runtime: %s (%s/%s)`,
name,
- version, b
uildBranch, commitHash
,
+ version, b
ranch, commit
,
buildUser, buildHost, buildDate.Format(time.UnixDate),
runtime.Version(), runtime.GOOS, runtime.GOARCH,
)
buildUser, buildHost, buildDate.Format(time.UnixDate),
runtime.Version(), runtime.GOOS, runtime.GOARCH,
)