Run() crashes if server can't be setup

This commit is contained in:
Manu Mtz-Almeida 2014-07-02 23:10:30 +02:00
parent 2e50e2cc60
commit 615f19961e
1 changed files with 3 additions and 1 deletions

4
gin.go
View File

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