From 25abc87d6f8c56ad1fb5b7120f4fdf39b85f1e73 Mon Sep 17 00:00:00 2001 From: Michael Li Date: Thu, 30 Mar 2023 17:31:40 +0800 Subject: [PATCH] optimize SetDefaultPrepareHook(...) logic that reset default prepare hook if give nil param --- yesql.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/yesql.go b/yesql.go index d757c41..dc003ed 100644 --- a/yesql.go +++ b/yesql.go @@ -40,7 +40,9 @@ func SetDefaultTag(tag string) { } // SetDefaultPrepareHook set default prepare hook +// Reset default prepare hook if hook is nil func SetDefaultPrepareHook(hook PrepareHook) { + _defaultPrepareScanner = nil if hook != nil { _defaultPrepareScanner = NewPrepareScanner(hook) }