Skip to content

Commit

Permalink
chore: simplify again
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Mar 22, 2024
1 parent 925e56d commit 9f1f2d1
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions contextcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,13 +584,11 @@ func (r *runner) checkFuncWithCtx(f *ssa.Function, tp entryType) {

key := ff.RelString(nil)
res, ok := r.getValue(key, ff)
if ok {
if !res.Valid {
if instr.Pos().IsValid() {
r.Reportf(instr, "Function `%s` should pass the context parameter", strings.Join(reverse(res.Funcs), "->"))
} else {
r.Reportf(ff, "Function `%s` should pass the context parameter", strings.Join(reverse(res.Funcs), "->"))
}
if ok && !res.Valid {
if instr.Pos().IsValid() {
r.Reportf(instr, "Function `%s` should pass the context parameter", strings.Join(reverse(res.Funcs), "->"))
} else {
r.Reportf(ff, "Function `%s` should pass the context parameter", strings.Join(reverse(res.Funcs), "->"))
}
}
}
Expand Down

0 comments on commit 9f1f2d1

Please sign in to comment.