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

Function metadataStringSlice

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

Source from the content-addressed store, hash-verified

270}
271
272func metadataStringSlice(metadata map[string]any, key string) []string {
273 if metadata == nil {
274 return nil
275 }
276 raw, ok := metadata[key]
277 if !ok {
278 return nil
279 }
280 switch values := raw.(type) {
281 case []string:
282 return values
283 case []any:
284 out := make([]string, 0, len(values))
285 for _, value := range values {
286 s := strings.TrimSpace(fmt.Sprint(value))
287 if s != "" {
288 out = append(out, s)
289 }
290 }
291 return out
292 default:
293 return nil
294 }
295}
296
297func metadataInt(metadata map[string]any, key string) int {
298 if metadata == nil {

Callers 1

evalAddReviewerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected