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

Function metadataInt

pkg/cli/outcome_eval_review.go:297–314  ·  view source on GitHub ↗
(metadata map[string]any, key string)

Source from the content-addressed store, hash-verified

295}
296
297func metadataInt(metadata map[string]any, key string) int {
298 if metadata == nil {
299 return 0
300 }
301 switch value := metadata[key].(type) {
302 case int:
303 return value
304 case int64:
305 return int(value)
306 case float64:
307 return int(value)
308 case string:
309 var parsed int
310 _, _ = fmt.Sscanf(value, "%d", &parsed)
311 return parsed
312 }
313 return 0
314}
315
316func outcomeString(raw any) string {
317 s, _ := raw.(string)

Callers 3

findReviewByIDFunction · 0.85
isLatestReviewFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected