mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
16 lines
302 B
Plaintext
16 lines
302 B
Plaintext
/**
|
|
* @name Comparison with nil
|
|
* @description Finds comparisons with nil.
|
|
* @id go/examples/nilcheck
|
|
* @tags comparison
|
|
* nil
|
|
*/
|
|
|
|
import go
|
|
|
|
from DataFlow::EqualityTestNode eq, DataFlow::Node nd, DataFlow::Node nil
|
|
where
|
|
nil = Builtin::nil().getARead() and
|
|
eq.eq(_, nd, nil)
|
|
select eq
|