From f540fc2c04f279d988a2a905ca35697f428a7926 Mon Sep 17 00:00:00 2001 From: sammyette Date: Mon, 10 Jul 2023 21:56:35 -0400 Subject: [PATCH] feat: show go version hilbish was compiled with --- api.go | 2 ++ main.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api.go b/api.go index a440693..61aac21 100644 --- a/api.go +++ b/api.go @@ -2,6 +2,7 @@ // The Hilbish module includes the core API, containing // interfaces and functions which directly relate to shell functionality. // #field ver The version of Hilbish +// #field goVersion The version of Go that Hilbish was compiled with // #field user Username of the user // #field host Hostname of the machine // #field dataDir Directory for Hilbish data files, including the docs and default modules @@ -110,6 +111,7 @@ func hilbishLoad(rtm *rt.Runtime) (rt.Value, func()) { } util.SetFieldProtected(fakeMod, mod, "ver", rt.StringValue(getVersion())) + util.SetFieldProtected(fakeMod, mod, "goVersion", rt.StringValue(runtime.Version())) util.SetFieldProtected(fakeMod, mod, "user", rt.StringValue(username)) util.SetFieldProtected(fakeMod, mod, "host", rt.StringValue(host)) util.SetFieldProtected(fakeMod, mod, "home", rt.StringValue(curuser.HomeDir)) diff --git a/main.go b/main.go index 4fa321c..300f333 100644 --- a/main.go +++ b/main.go @@ -106,7 +106,7 @@ func main() { } if *verflag { - fmt.Printf("Hilbish %s\n", getVersion()) + fmt.Printf("Hilbish %s\nCompiled with %s\n", getVersion(), runtime.Version()) os.Exit(0) }