Skip to content

Commit

Permalink
optimize SetDefaultPrepareHook(...) logic that reset default prepare …
Browse files Browse the repository at this point in the history
…hook if give nil param
  • Loading branch information
alimy committed Mar 30, 2023
1 parent 91bd63e commit 25abc87
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions yesql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 25abc87

Please sign in to comment.