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).
Since
filesAnalyzed
is an optional field, it is set as omitempty. However, whenfilesAnalyzed
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 PackageReported on behalf on Google internal user (Amit).