fix:#41 fixed sonarqube hotspots

This commit is contained in:
Elmar Kresse
2024-06-24 12:18:48 +02:00
parent cb8de60d21
commit ff2fa1b67d
6 changed files with 182 additions and 6 deletions

View File

@@ -27,7 +27,7 @@ import (
"strings"
)
func main() {
func setupApp() *pocketbase.PocketBase {
app := pocketbase.New()
// loosely check if it was executed using "go run"
@@ -44,8 +44,12 @@ func main() {
service.AddRoutes(app)
service.AddSchedules(app)
return app
}
func main() {
app := setupApp()
if err := app.Start(); err != nil {
slog.Error("Failed to start app: ", "error", err)
}
}