MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / orEmptyStrings

Function orEmptyStrings

internal/httpapi/messages.go:699–704  ·  view source on GitHub ↗

orEmptyStrings normalizes a nil slice to a non-nil empty slice so the field renders as [] rather than null — matching the legacy orEmptySlice behavior for `to` and `labels`.

(s []string)

Source from the content-addressed store, hash-verified

697// field renders as [] rather than null — matching the legacy orEmptySlice
698// behavior for `to` and `labels`.
699func orEmptyStrings(s []string) []string {
700 if s == nil {
701 return []string{}
702 }
703 return s
704}
705
706// orEmpty coalesces a nil slice of any element type to an empty slice so the
707// JSON renders as [] rather than null (A-3). Pair with `nullable:"false"` on

Callers 6

messageViewFromIdentityFunction · 0.85
handleUpdateMessageMethod · 0.85
reviewViewFunction · 0.85
webhookViewFunction · 0.85
handleGetConversationMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected