Skip to content

Commit 39cf7c9

Browse files
Rafael Chaconbramp
authored andcommitted
No need to have a variable for this return value
Signed-off-by: Rafael Chacon <[email protected]>
1 parent eb42a0b commit 39cf7c9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

comments.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -262,30 +262,30 @@ func (d CommentDirectives) IsSet(key string) bool {
262262
}
263263

264264
// SkipQueryPlanCacheDirective returns true if skip query plan cache directive is set to true in query.
265-
func SkipQueryPlanCacheDirective(stmt Statement) (skipQuerPlanCacheDirective bool) {
265+
func SkipQueryPlanCacheDirective(stmt Statement) bool {
266266
switch stmt := stmt.(type) {
267267
case *Select:
268268
directives := ExtractCommentDirectives(stmt.Comments)
269269
if directives.IsSet(DirectiveSkipQueryPlanCache) {
270-
skipQuerPlanCacheDirective = true
270+
return true
271271
}
272272
case *Insert:
273273
directives := ExtractCommentDirectives(stmt.Comments)
274274
if directives.IsSet(DirectiveSkipQueryPlanCache) {
275-
skipQuerPlanCacheDirective = true
275+
return true
276276
}
277277
case *Update:
278278
directives := ExtractCommentDirectives(stmt.Comments)
279279
if directives.IsSet(DirectiveSkipQueryPlanCache) {
280-
skipQuerPlanCacheDirective = true
280+
return true
281281
}
282282
case *Delete:
283283
directives := ExtractCommentDirectives(stmt.Comments)
284284
if directives.IsSet(DirectiveSkipQueryPlanCache) {
285-
skipQuerPlanCacheDirective = true
285+
return true
286286
}
287287
default:
288-
skipQuerPlanCacheDirective = false
288+
return false
289289
}
290-
return skipQuerPlanCacheDirective
290+
return false
291291
}

0 commit comments

Comments
 (0)