MCPcopy
hub / github.com/ossf/scorecard / WithLocation

Method WithLocation

finding/finding.go:206–216  ·  view source on GitHub ↗

WithLocation adds a location to an existing finding. No copy is made.

(loc *Location)

Source from the content-addressed store, hash-verified

204// WithLocation adds a location to an existing finding.
205// No copy is made.
206func (f *Finding) WithLocation(loc *Location) *Finding {
207 f.Location = loc
208 if f.Remediation != nil && f.Location != nil {
209 // Replace location data.
210 f.Remediation.Text = strings.ReplaceAll(f.Remediation.Text,
211 "${{ finding.location.path }}", f.Location.Path)
212 f.Remediation.Markdown = strings.ReplaceAll(f.Remediation.Markdown,
213 "${{ finding.location.path }}", f.Location.Path)
214 }
215 return f
216}
217
218// WithValues sets the values to an existing finding.
219// No copy is made.

Callers 13

NewWithFunction · 0.80
Test_FromBytesFunction · 0.80
RunFunction · 0.80
CreateFalseFindingFunction · 0.80
ReadTrueLevelFindingFunction · 0.80
CreateNoneFindingFunction · 0.80
RunFunction · 0.80
RunFunction · 0.80
RunFunction · 0.80
RunFunction · 0.80
RunFunction · 0.80
prHasSuccessStatusFunction · 0.80

Calls

no outgoing calls

Tested by 1

Test_FromBytesFunction · 0.64