@@ -68,7 +68,7 @@ func enrichCDXLicense(comp *cdx.Component, pkgVersionData *packages.VersionWithD
6868 }
6969}
7070
71- func enrichCDXExternalReference (comp * cdx.Component , ref * string , refType cdx.ExternalReferenceType ) {
71+ func enrichExternalReference (comp * cdx.Component , ref * string , refType cdx.ExternalReferenceType ) {
7272 if ref == nil {
7373 return
7474 }
@@ -86,7 +86,7 @@ func enrichCDXExternalReference(comp *cdx.Component, ref *string, refType cdx.Ex
8686 }
8787}
8888
89- func enrichCDXProperty (comp * cdx.Component , name string , value string ) {
89+ func enrichProperty (comp * cdx.Component , name string , value string ) {
9090 prop := cdx.Property {
9191 Name : name ,
9292 Value : value ,
@@ -99,41 +99,41 @@ func enrichCDXProperty(comp *cdx.Component, name string, value string) {
9999}
100100
101101func enrichCDXHomepage (comp * cdx.Component , data * packages.Package ) {
102- enrichCDXExternalReference (comp , data .Homepage , cdx .ERTypeWebsite )
102+ enrichExternalReference (comp , data .Homepage , cdx .ERTypeWebsite )
103103}
104104
105105func enrichCDXRegistryURL (comp * cdx.Component , data * packages.Package ) {
106- enrichCDXExternalReference (comp , data .RegistryUrl , cdx .ERTypeDistribution )
106+ enrichExternalReference (comp , data .RegistryUrl , cdx .ERTypeDistribution )
107107}
108108
109109func enrichCDXRepositoryURL (comp * cdx.Component , data * packages.Package ) {
110- enrichCDXExternalReference (comp , data .RepositoryUrl , cdx .ERTypeVCS )
110+ enrichExternalReference (comp , data .RepositoryUrl , cdx .ERTypeVCS )
111111}
112112
113113func enrichCDXDocumentationURL (comp * cdx.Component , data * packages.Package ) {
114- enrichCDXExternalReference (comp , data .DocumentationUrl , cdx .ERTypeDocumentation )
114+ enrichExternalReference (comp , data .DocumentationUrl , cdx .ERTypeDocumentation )
115115}
116116
117117func enrichCDXFirstReleasePublishedAt (comp * cdx.Component , data * packages.Package ) {
118118 if data .FirstReleasePublishedAt == nil {
119119 return
120120 }
121121 timestamp := data .FirstReleasePublishedAt .UTC ().Format (time .RFC3339 )
122- enrichCDXProperty (comp , "ecosystems:first_release_published_at" , timestamp )
122+ enrichProperty (comp , "ecosystems:first_release_published_at" , timestamp )
123123}
124124
125125func enrichCDXLatestReleasePublishedAt (comp * cdx.Component , data * packages.Package ) {
126126 if data .LatestReleasePublishedAt == nil {
127127 return
128128 }
129129 timestamp := data .LatestReleasePublishedAt .UTC ().Format (time .RFC3339 )
130- enrichCDXProperty (comp , "ecosystems:latest_release_published_at" , timestamp )
130+ enrichProperty (comp , "ecosystems:latest_release_published_at" , timestamp )
131131}
132132
133133func enrichCDXRepoArchived (comp * cdx.Component , data * packages.Package ) {
134134 if data .RepoMetadata != nil {
135135 if archived , ok := (* data .RepoMetadata )["archived" ].(bool ); ok && archived {
136- enrichCDXProperty (comp , "ecosystems:repository_archived" , "true" )
136+ enrichProperty (comp , "ecosystems:repository_archived" , "true" )
137137 }
138138 }
139139}
@@ -143,7 +143,7 @@ func enrichCDXLocation(comp *cdx.Component, data *packages.Package) {
143143 meta := * data .RepoMetadata
144144 if ownerRecord , ok := meta ["owner_record" ].(map [string ]interface {}); ok {
145145 if location , ok := ownerRecord ["location" ].(string ); ok {
146- enrichCDXProperty (comp , "ecosystems:owner_location" , location )
146+ enrichProperty (comp , "ecosystems:owner_location" , location )
147147 }
148148 }
149149 }
@@ -188,7 +188,7 @@ func enrichCDXTopics(comp *cdx.Component, data *packages.Package) {
188188 if topics , ok := meta ["topics" ].([]interface {}); ok {
189189 for _ , topic := range topics {
190190 if s , ok := topic .(string ); ok {
191- enrichCDXProperty (comp , "ecosystems:topic" , s )
191+ enrichProperty (comp , "ecosystems:topic" , s )
192192 }
193193 }
194194 }
0 commit comments