Skip to content

Commit fb74a2a

Browse files
committed
Use "" in qualified name for entities without a package
1 parent 0338ffd commit fb74a2a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

go/ql/lib/semmle/go/Scopes.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ class Entity extends @object {
103103
*/
104104
pragma[nomagic]
105105
predicate hasQualifiedName(string pkg, string name) {
106-
pkg = this.getPackage().getPath() and
106+
(
107+
pkg = this.getPackage().getPath()
108+
or
109+
not exists(this.getPackage()) and pkg = ""
110+
) and
107111
name = this.getName()
108112
}
109113

0 commit comments

Comments
 (0)