From 176fd55de4d9ff24da04aed1c5fa0991b62f6799 Mon Sep 17 00:00:00 2001 From: sljeff Date: Tue, 8 Sep 2020 16:17:48 +0800 Subject: [PATCH] fix close stubext --- extensions/stubext/ext.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/stubext/ext.go b/extensions/stubext/ext.go index cca7e46e..4bc704dd 100644 --- a/extensions/stubext/ext.go +++ b/extensions/stubext/ext.go @@ -55,7 +55,12 @@ func (d *StubExt) Application() *gobay.Application { return d.app } func (d *StubExt) Object() interface{} { return d } -func (d *StubExt) Close() error { return d.conn.Close() } +func (d *StubExt) Close() error { + if d.Mocked { + return nil + } + return d.conn.Close() +} func (d *StubExt) Init(app *gobay.Application) error { if d.NS == "" {