MCPcopy Create free account
hub / github.com/github/gh-aw / runAuditAnalysis

Function runAuditAnalysis

pkg/cli/audit.go:736–748  ·  view source on GitHub ↗
(wg *sync.WaitGroup, verbose bool, name, warning string, setter func(T), fn func() (T, error))

Source from the content-addressed store, hash-verified

734}
735
736func runAuditAnalysis[T any](wg *sync.WaitGroup, verbose bool, name, warning string, setter func(T), fn func() (T, error)) {
737 wg.Go(func() {
738 value, err := fn()
739 if err != nil {
740 auditLog.Printf("%s failed: %v", name, err)
741 if verbose {
742 fmt.Fprintln(os.Stderr, console.FormatWarningMessage(fmt.Sprintf("%s: %v", warning, err)))
743 }
744 return
745 }
746 setter(value)
747 })
748}
749
750func applyAuditMetrics(run WorkflowRun, results auditAnalysisResults) WorkflowRun {
751 run.TokenUsage = results.metrics.TokenUsage

Callers 3

launchCoreAuditAnalysesFunction · 0.85

Calls 3

FormatWarningMessageFunction · 0.92
fnFunction · 0.85
PrintfMethod · 0.45

Tested by

no test coverage detected