diff options
author | EuAndreh <eu@euandre.org> | 2024-08-15 06:30:54 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-08-15 07:39:58 -0300 |
commit | db0315223571daaf43ab5e8456bed7f3d7f9dafa (patch) | |
tree | 263a7463c2e583fc91e2fe849e1752ab3a72f25e /src | |
parent | Use "go tool" to build project (diff) | |
download | papod-db0315223571daaf43ab5e8456bed7f3d7f9dafa.tar.gz papod-db0315223571daaf43ab5e8456bed7f3d7f9dafa.tar.xz |
Add src/version.go
Diffstat (limited to 'src')
-rw-r--r-- | src/papod.go | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/papod.go b/src/papod.go index 91e1145..05b1d8e 100644 --- a/src/papod.go +++ b/src/papod.go @@ -9,6 +9,7 @@ import ( "fmt" "io" "io/ioutil" + "log/slog" "net" "os" "regexp" @@ -18,7 +19,7 @@ import ( "time" g "gobang" - _ "golite" + "golite" ) @@ -26,19 +27,11 @@ import ( // Global variables -var ( - Version string - Colour string -) +var Colour string func SetEnvironmentVariables() { - Version = os.Getenv("PAPOD_VERSION") - if Version == "" { - Version = "PAPOD-VERSION-UNKNOWN" - } - Colour = os.Getenv("PAPOD_COLOUR") if Colour == "" { Colour = "PAPOD-COLOUR-UNKNOWN" @@ -509,7 +502,12 @@ func InitDB(databasePath string) *sql.DB { } func Init() { - g.Init() + g.Init(slog.Group( + "versions", + "gobang", g.Version, + "golite", golite.Version, + "this", version, + )) SetEnvironmentVariables() } |