spdx / tools-golang

Collection of Go packages to work with SPDX files
Other
130 stars 59 forks source link

"filesAnalyzed" field is not working when set to false #209

Closed lumjjb closed 1 year ago

lumjjb commented 1 year ago

Since filesAnalyzed is an optional field, it is set as omitempty. However, when filesAnalyzed is omitted, the default value is true. The purpose of the IsFilesAnalyzedTagPresent is to force the output of filesAnalyzed to false if it is the case (since golang default unmarshaling treats false as the default boolean empty value).

This unfortunately doesn't work and today, it is not possible to output a document that accurately sets filesAnalyzed=false for Package

Reported on behalf on Google internal user (Amit).