tools-golang
tools-golang copied to clipboard
Consider whether to add top-level map of all IDs
Separate tracking issue for @goneall's comment at https://github.com/spdx/tools-golang/issues/24#issuecomment-626220481:
This means that probably this should just be replaced with a top-level "UnpackagedFiles" map of ElementIDs to Files at the Document level, and pull it out of the "Packages" map altogether.
For the Java code, there is simply a map of all SpdxElements within a document which includes both packages and files (since they subclass elements). There is a separate property for the Package that references the files.
Consider whether to add this to the Document structure. It would enable quickly finding an element. In particular, for documents with multiple Packages and Files within each one, it would enable quickly finding a File by ID with a single lookup, rather than crawling through each Package's set of Files.
Hey, @swinslow can I try my hand on this issue? I would like to give it a go.
Marking this as part of 0.4.0, so we can consider it together with some other potential API changes for that release.