Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxincs committed Oct 4, 2024
1 parent f2c9545 commit fca4e01
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions testdata/src/go.uber.org/testing/trustedfuncs.go
Original file line number Diff line number Diff line change
Expand Up @@ -995,5 +995,11 @@ func errorsAs(err error, num string, dummy bool) {
print(*exitErr) //want "unassigned variable `exitErr` dereferenced"
print(*anotherErr) //want "unassigned variable `anotherErr` dereferenced"
}
case "nil dereference in first argument":
var exitErr *exec.ExitError
var nilError *error
if errors.As(*nilError, &exitErr) { //want "unassigned variable `nilError` dereferenced"
print(*exitErr) // But this is fine!
}
}
}

0 comments on commit fca4e01

Please sign in to comment.