diff options
author | EuAndreh <eu@euandre.org> | 2024-10-20 03:52:56 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-10-20 03:54:03 -0300 |
commit | e89b85550e53bacaf2c9385375ae084b1f0bda50 (patch) | |
tree | edda714736665b796b0913bc5bd487edb616519d /src | |
parent | Makefile: "var version" -> "const Version" (diff) | |
download | glaze-e89b85550e53bacaf2c9385375ae084b1f0bda50.tar.gz glaze-e89b85550e53bacaf2c9385375ae084b1f0bda50.tar.xz |
Adapt to latest golang Makefile skeleton
Diffstat (limited to 'src')
-rw-r--r-- | src/glaze.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/glaze.go b/src/glaze.go index f5b2886..1431ba4 100644 --- a/src/glaze.go +++ b/src/glaze.go @@ -15,7 +15,7 @@ import ( "strings" "syscall" - + "guuid" g "gobang" ) @@ -204,7 +204,7 @@ func handlerForDynPath(path string) (pathInfo, func(pathInfo, http.ResponseWrite func handlerFor(path string) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - id := g.NewUUID() + id := guuid.New() g.Info("in-request", "in-request", "path", path, "id", id) defer g.Info("in-response", "in-response", "path", path, "id", id) @@ -268,10 +268,14 @@ func start(listener net.Listener) { g.FatalIf(err) } +func Init() { + g.Init(slog.Group("versions", "gobang", g.Version, "this", Version)) +} + func Main() { - g.Init(slog.Group("versions", "gobang", g.Version, "this", version)) + Init() addr := parseArgs(os.Args) listener := listen(addr) start(listener) |