codeql icon indicating copy to clipboard operation
codeql copied to clipboard

Go: Use objectpath for object labels in extractor

Open owen-mc opened this issue 1 year ago • 0 comments
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.

owen-mc avatar Jun 12 '24 15:06 owen-mc