From 0179262628cadd3ed402880a03f3d812f327feec Mon Sep 17 00:00:00 2001 From: René 'Necoro' Neumann Date: Tue, 21 Apr 2020 22:20:42 +0200 Subject: Improved HTML creation --- internal/config/config.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'internal/config/config.go') diff --git a/internal/config/config.go b/internal/config/config.go index 409cbdf..6c74c2e 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -5,6 +5,7 @@ import ( "os" "os/user" "runtime" + "runtime/debug" "strings" ) @@ -62,6 +63,14 @@ func (c *Config) WithPartHtml() bool { return false } +func Version() string { + bi, ok := debug.ReadBuildInfo() + if !ok { + return "(unknown)" + } + return bi.Main.Version +} + func hostname() (hostname string) { hostname, err := os.Hostname() if err != nil { -- cgit v1.2.3-54-g00ecf