MCPcopy Index your code
hub / github.com/containerd/containerd / readString

Function readString

cmd/containerd/server/server.go:417–440  ·  view source on GitHub ↗
(properties map[string]any, key ...string)

Source from the content-addressed store, hash-verified

415}
416
417func readString(properties map[string]any, key ...string) string {
418 for i, k := range key {
419 v, ok := properties[k]
420 if !ok {
421 return ""
422 }
423 if i < len(key)-1 {
424 properties, ok = v.(map[string]any)
425 if !ok {
426 return ""
427 }
428 continue
429 }
430 switch v := v.(type) {
431 case string:
432 return v
433 case fmt.Stringer:
434 return v.String()
435 case []byte:
436 return string(v)
437 }
438 }
439 return ""
440}

Callers 1

NewFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…