Remove unncessary recover() calls (#14066)
* Remove unncessary recover() calls A recover which is not called inside a defer will always return nil. So there's no use of calling it. And even if we did call it inside a defer, recovering and immediately panicking does not make sense either. So we just remove it. * Fixed another instance
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
9369d65441
Коммит
42081a1441
@@ -246,10 +246,6 @@ func (me *TestHelper) TearDown() {
|
||||
me.ShutdownApp()
|
||||
|
||||
utils.EnableDebugLogForTest()
|
||||
|
||||
if err := recover(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
var initBasicOnce sync.Once
|
||||
|
||||
@@ -567,9 +567,6 @@ func (me *TestHelper) TearDown() {
|
||||
me.App.InvalidateAllCaches()
|
||||
}
|
||||
me.ShutdownApp()
|
||||
if err := recover(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if me.tempWorkspace != "" {
|
||||
os.RemoveAll(me.tempWorkspace)
|
||||
}
|
||||
|
||||
@@ -250,9 +250,6 @@ func (me *TestHelper) TearDown() {
|
||||
// Clean all the caches
|
||||
me.App.InvalidateAllCaches()
|
||||
me.Server.Shutdown()
|
||||
if err := recover(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if me.tempWorkspace != "" {
|
||||
os.RemoveAll(me.tempWorkspace)
|
||||
}
|
||||
|
||||
@@ -158,9 +158,6 @@ func (th *TestHelper) TearDown() {
|
||||
th.App.InvalidateAllCaches()
|
||||
}
|
||||
th.Server.Shutdown()
|
||||
if err := recover(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestStaticFilesRequest(t *testing.T) {
|
||||
|
||||
Ссылка в новой задаче
Block a user