MCPcopy
hub / github.com/cloudfoundry/cli / formatDescription

Function formatDescription

cf/api/resources/events.go:85–94  ·  view source on GitHub ↗
(metadata generic.Map, keys []string)

Source from the content-addressed store, hash-verified

83}
84
85func formatDescription(metadata generic.Map, keys []string) string {
86 parts := []string{}
87 for _, key := range keys {
88 value := metadata.Get(key)
89 if value != nil {
90 parts = append(parts, fmt.Sprintf("%s: %s", key, formatDescriptionPart(value)))
91 }
92 }
93 return strings.Join(parts, ", ")
94}
95
96func formatDescriptionPart(val interface{}) string {
97 switch val := val.(type) {

Callers 1

ToFieldsMethod · 0.70

Calls 2

formatDescriptionPartFunction · 0.70
GetMethod · 0.65

Tested by

no test coverage detected