1
0
Fork 0
mirror of https://github.com/gocsaf/csaf.git synced 2025-12-22 05:40:11 +01:00

Add forgotten validation for metadata

This commit is contained in:
Sascha L. Teichmann 2022-06-23 19:48:02 +02:00
parent 38d3679704
commit bace61e0b3

View file

@ -318,6 +318,24 @@ func (a *Aggregator) Validate() error {
return nil
}
// UnmarshalText implements the encoding.TextUnmarshaller interface.
func (mdv *MetadataVersion) UnmarshalText(data []byte) error {
s, err := metadataVersionPattern(data)
if err == nil {
*mdv = MetadataVersion(s)
}
return err
}
// UnmarshalText implements the encoding.TextUnmarshaller interface.
func (mdr *MetadataRole) UnmarshalText(data []byte) error {
s, err := metadataRolePattern(data)
if err == nil {
*mdr = MetadataRole(s)
}
return err
}
// UnmarshalText implements the encoding.TextUnmarshaller interface.
func (ac *AggregatorCategory) UnmarshalText(data []byte) error {
s, err := aggregatorCategoryPattern(data)