diff options
author | Steve Winslow <steve@swinslow.net> | 2021-03-20 17:16:31 -0400 |
---|---|---|
committer | Steve Winslow <steve@swinslow.net> | 2021-03-20 17:16:31 -0400 |
commit | 6234aa66fed08ee03a2be31ec177152cefeedfd2 (patch) | |
tree | 8f62b5948cffe465927cc06a6eb83c815ac39d04 /examples | |
parent | ad870ed6f31eb4918018af143611a5a2dc6aa798 (diff) | |
download | spdx-tools-6234aa66fed08ee03a2be31ec177152cefeedfd2.tar.gz |
Fix special IDs for right-side 2.2 Relationships
In SPDX 2.2, the right-hand side of Relationships are not limited
to SPDX IDs; they can also include the special values NONE and
NOASSERTION.
To handle these, since Golang doesn't (to my knowledge) have a
concept of union types, and since I don't want to use interface{},
this commit instead adds a new SpecialID field to DocElementID.
When SpecialID is non-empty, it should be treated as being a
"special" ID value, and DocumentRefID / ElementRefID should be
ignored.
(Unfortunately, we can't just use ElementRefID == "NONE", etc.
for this purpose, because in theory an SPDX document could define
the identifier SPDXRef-NONE to mean something. Even though they
really, really shouldn't do that.)
This commit updates tvloader and tvsaver to appropriately handle
the possibility of NONE and NOASSERTION for this field.
Signed-off-by: Steve Winslow <steve@swinslow.net>
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions