~inferiormartin/gravel

50ff27d88c23e29b0085f1fc3154be0a97dddd56 — Maarten Vos 4 months ago 1e3cc13
Remove StartTime from App
2 files changed, 6 insertions(+), 11 deletions(-)

M app.go
M diagnostics.go
M app.go => app.go +6 -10
@@ 6,17 6,15 @@ import (
	"git.sr.ht/~inferiormartin/badger/config"
	"git.sr.ht/~inferiormartin/badger/model"
	"git.sr.ht/~inferiormartin/badger/user"
	"html/template"
	"io/fs"
	"log"
	"net/http"
	"time"

	"github.com/go-chi/chi/v5"
	"github.com/go-chi/chi/v5/middleware"
	"github.com/jmoiron/sqlx"
	_ "github.com/lib/pq"
	"github.com/vaughan0/go-ini"
	"html/template"
	"io/fs"
	"log"
	"net/http"
)

//go:embed templates/*.html static/* model.json


@@ 24,7 22,6 @@ var content embed.FS

type App struct {
	Config    *ini.File
	StartTime time.Time
	Template  *template.Template
	AppName   string
	Advanced  *Advanced


@@ 83,9 80,8 @@ func Default() *App {
	}

	app := &App{
		Config:    cfg,
		StartTime: time.Now(),
		Template:  tmpl,
		Config:   cfg,
		Template: tmpl,
		ModelDb: &ModelDb{
			Db:                 modelDb,
			querySources:       map[string]QuerySource{},

M diagnostics.go => diagnostics.go +0 -1
@@ 21,7 21,6 @@ func (app *App) onDiagnostics() http.HandlerFunc {

		data := make(map[string]any)

		data["uptime"] = app.StartTime
		data["os"] = runtime.GOOS
		data["arch"] = runtime.GOARCH
		data["go"] = runtime.Version()