Use proper error comparison

This commit is contained in:
Maximilian 2023-08-03 12:13:37 -05:00
parent 7cb36db3c2
commit fa3165d317

View File

@ -8,6 +8,7 @@ import (
"GoWeb/routes" "GoWeb/routes"
"context" "context"
"embed" "embed"
"errors"
"log" "log"
"net/http" "net/http"
"os" "os"
@ -68,7 +69,7 @@ func main() {
go func() { go func() {
log.Println("Starting server and listening on " + appLoaded.Config.Listen.Ip + ":" + appLoaded.Config.Listen.Port) log.Println("Starting server and listening on " + appLoaded.Config.Listen.Ip + ":" + appLoaded.Config.Listen.Port)
err := server.ListenAndServe() err := server.ListenAndServe()
if err != nil && err != http.ErrServerClosed { if err != nil && !errors.Is(err, http.ErrServerClosed) {
log.Fatalf("Could not listen on %s: %v\n", appLoaded.Config.Listen.Ip+":"+appLoaded.Config.Listen.Port, err) log.Fatalf("Could not listen on %s: %v\n", appLoaded.Config.Listen.Ip+":"+appLoaded.Config.Listen.Port, err)
} }
}() }()