From 7db23ba469d2650da16740f94e858c81c1b8b2a0 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 5 Nov 2014 15:40:44 +0800 Subject: [PATCH] bug fixed for unscoped --- engine.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine.go b/engine.go index 6c974d7a..07a23d30 100644 --- a/engine.go +++ b/engine.go @@ -1420,6 +1420,6 @@ func (engine *Engine) FormatTime(sqlTypeName string, t time.Time) (v interface{} // Always disable struct tag "deleted" func (engine *Engine) Unscoped() *Session { session := engine.NewSession() - defer session.Close() + session.IsAutoClose = true return session.Unscoped() }