feat: display app version in UI footer
- Add version package with build-time variables - Inject version via ldflags in Dockerfile using git describe - Show version in footer on every page - Log version and commit on server startup
This commit is contained in:
3
main.go
3
main.go
@@ -20,6 +20,7 @@ import (
|
||||
"github.com/ryanhamamura/games/router"
|
||||
"github.com/ryanhamamura/games/sessions"
|
||||
"github.com/ryanhamamura/games/snake"
|
||||
"github.com/ryanhamamura/games/version"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
@@ -45,7 +46,7 @@ func main() {
|
||||
func run(ctx context.Context) error {
|
||||
cfg := config.Global
|
||||
addr := fmt.Sprintf("%s:%s", cfg.Host, cfg.Port)
|
||||
slog.Info("server starting", "addr", addr)
|
||||
slog.Info("server starting", "addr", addr, "version", version.Version, "commit", version.Commit)
|
||||
defer slog.Info("server shutdown complete")
|
||||
|
||||
eg, egctx := errgroup.WithContext(ctx)
|
||||
|
||||
Reference in New Issue
Block a user