Skip to content

Commit 754fd8e

Browse files
committed
Drop leading . from getQualifiedName for built-in functions
So it will be "panic" instead of ".panic".
1 parent 68a661f commit 754fd8e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ class Entity extends @object {
113113

114114
/** Gets the qualified name of this entity, if any. */
115115
string getQualifiedName() {
116-
exists(string pkg, string name | this.hasQualifiedName(pkg, name) | result = pkg + "." + name)
116+
exists(string pkg, string name | this.hasQualifiedName(pkg, name) |
117+
if pkg = "" then result = name else result = pkg + "." + name
118+
)
117119
}
118120

119121
/**

0 commit comments

Comments
 (0)