Skip to content

Commit

Permalink
refactor: linter upset about defer before log.fatal
Browse files Browse the repository at this point in the history
  • Loading branch information
MalinAhlberg committed Nov 22, 2024
1 parent 6f888e2 commit 591c53e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sda/cmd/auth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@ func main() {
log.Error("database schema v14 is required")
panic(err)
}
defer authHandler.Config.DB.Close()

app.RegisterView(iris.HTML(authHandler.htmlDir, ".html"))
app.HandleDir("/public", iris.Dir(authHandler.staticDir))
Expand All @@ -439,6 +438,8 @@ func main() {
// Endpoint for client login info
app.Get("/info", authHandler.getInfo)

defer authHandler.Config.DB.Close() // needs to be after Fatalf

app.UseGlobal(globalHeaders)

if config.Server.Cert != "" && config.Server.Key != "" {
Expand Down

0 comments on commit 591c53e

Please sign in to comment.