Explorar o código

Run() crashes if server can't be setup

Manu Mtz-Almeida %!s(int64=11) %!d(string=hai) anos
pai
achega
615f19961e
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      gin.go

+ 3 - 1
gin.go

@@ -129,7 +129,9 @@ func (engine *Engine) ServeHTTP(w http.ResponseWriter, req *http.Request) {
 }
 
 func (engine *Engine) Run(addr string) {
-	http.ListenAndServe(addr, engine)
+	if err := http.ListenAndServe(addr, engine); err != nil {
+		panic(err)
+	}
 }
 
 /************************************/