我尝试使用mgo.DialWithInfo函数对与MongoDB的连接进行单元测试(在失败的情况下)。mgo.DialWithInfo不返回错误,而是出现panic。我尝试添加恢复逻辑以从panic中恢复,但没有成功。我的问题是:为什么mgo.DialWithInfo没有返回error而是panic?为什么我的恢复不起作用?代码:函数funcConnect(mongoDBDialInfo*mgo.DialInfo)error{log.Infof("connecttoMongoDBwith%v",mongoDBDialInfo)deferfunc(){ifr:=recover();r!=