aboutsummaryrefslogtreecommitdiffstats
path: root/version/version.go
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2020-06-16 10:40:34 +0200
committerOndrej Fabry <ofabry@cisco.com>2020-06-16 10:40:34 +0200
commit280b1c6c83b676ef4e592f4ecf60cb5b54b6a753 (patch)
treebf9a35f020de061ba66a432411ee44866405fe76 /version/version.go
parentf049390060630c0085fe4ad683c83a4a14a47ffb (diff)
Optimize socketclient adapter and add various code improvements
This commit includes: Features - optimized [socketclient](adapter/socketclient) adapter and add method to set client name - added list of compatible messages to `CompatibilityError` Fixes - `MsgCodec` will recover panic occurring during a message decoding - calling `Unsubscibe` will close the notification channel Other - improved log messages to provide more relevant info Examples - added more code samples of working with unions in [union example](examples/union-example) - added profiling mode to [perf bench](examples/perf-bench) example - improved [simple client](examples/simple-client) example to work properly even with multiple runs Dependencies - updated `github.com/sirupsen/logrus` dep to `v1.6.0` - updated `github.com/lunixbochs/struc` dep to `v0.0.0-20200521075829-a4cb8d33dbbe` Change-Id: I136a3968ccf9e93760d7ee2b9902fc7e6390a09d Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'version/version.go')
-rw-r--r--version/version.go23
1 files changed, 15 insertions, 8 deletions
diff --git a/version/version.go b/version/version.go
index eb8063a..8bde72c 100644
--- a/version/version.go
+++ b/version/version.go
@@ -21,14 +21,17 @@ import (
"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 (
- name = "govpp"
- version = "v0.3.5"
- commitHash = "unknown"
- buildBranch = "HEAD"
- buildStamp = ""
- buildUser = ""
- buildHost = ""
+ name = "govpp"
+ version = "v0.4.0-dev"
+ commit = "unknown"
+ branch = "HEAD"
+ buildStamp = ""
+ buildUser = ""
+ buildHost = ""
buildDate time.Time
)
@@ -41,6 +44,10 @@ func init() {
buildDate = time.Unix(buildstampInt64, 0)
}
+func Version() string {
+ return 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,
- version, buildBranch, commitHash,
+ version, branch, commit,
buildUser, buildHost, buildDate.Format(time.UnixDate),
runtime.Version(), runtime.GOOS, runtime.GOARCH,
)