From 615f19961ee3eb63f5e80acd6cb58ecdf61357c9 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Wed, 2 Jul 2014 23:10:30 +0200 Subject: [PATCH] Run() crashes if server can't be setup --- gin.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gin.go b/gin.go index 847df19..4d163d5 100644 --- a/gin.go +++ b/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) + } } /************************************/