CodeQL library for Go
codeql/go-all 4.2.1-dev (changelog, source)
Search

Member predicate Entity::getDeclaration

Gets the declaring identifier for this entity, if any.

Note that type switch statements which declare a new variable in the guard actually have a new variable (of the right type) implicitly declared at the beginning of each case clause, and these do not have a syntactic declaration.

Ident getDeclaration()