codeql
codeql copied to clipboard
Go: Use objectpath for object labels in extractor
trafficstars
This is based on top of https://github.com/github/codeql/pull/16737 so ignore the first two commits.
This is ground work for https://github.com/github/codeql/pull/15216. In that PR, we extract objects for type parameters, and they need labels that are the same even when generated when extracting different packages. We do that for objects in package scope, which was previously enough, but type parameters are not in package scope. This PR introduces the use of golang.org/x/tools/go/types/objectpath to generate canonical paths for exported objects, which solves the problem.