diff options
Diffstat (limited to 'proxy.go')
-rw-r--r-- | proxy.go | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -9,6 +9,7 @@ import ( "os" "path/filepath" "regexp" + "runtime/debug" "strings" "sync" ) @@ -40,3 +41,19 @@ func Path(path ...string) string { return proxyDir + "/" + strings.Join(path, "") } + +// Version returns the version string of the running instance. +func Version() (version string, ok bool) { + info, ok := debug.ReadBuildInfo() + if !ok { + return + } + + for _, dep := range info.Deps { + if dep.Path == "github.com/HimbeerserverDE/mt-multiserver-proxy" { + return dep.Version, true + } + } + + return +} |