Skip to content

Commit 9f1f2d1

Browse files
committed
chore: simplify again
1 parent 925e56d commit 9f1f2d1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

contextcheck.go

+5-7
Original file line numberDiff line numberDiff line change
@@ -584,13 +584,11 @@ func (r *runner) checkFuncWithCtx(f *ssa.Function, tp entryType) {
584584

585585
key := ff.RelString(nil)
586586
res, ok := r.getValue(key, ff)
587-
if ok {
588-
if !res.Valid {
589-
if instr.Pos().IsValid() {
590-
r.Reportf(instr, "Function `%s` should pass the context parameter", strings.Join(reverse(res.Funcs), "->"))
591-
} else {
592-
r.Reportf(ff, "Function `%s` should pass the context parameter", strings.Join(reverse(res.Funcs), "->"))
593-
}
587+
if ok && !res.Valid {
588+
if instr.Pos().IsValid() {
589+
r.Reportf(instr, "Function `%s` should pass the context parameter", strings.Join(reverse(res.Funcs), "->"))
590+
} else {
591+
r.Reportf(ff, "Function `%s` should pass the context parameter", strings.Join(reverse(res.Funcs), "->"))
594592
}
595593
}
596594
}

0 commit comments

Comments
 (0)