MCPcopy
hub / github.com/rs/zerolog / joinPrefix

Function joinPrefix

slog.go:167–175  ·  view source on GitHub ↗

joinPrefix concatenates a prefix and key with a dot separator. It avoids allocations when either prefix or key is empty.

(prefix, key string)

Source from the content-addressed store, hash-verified

165// joinPrefix concatenates a prefix and key with a dot separator.
166// It avoids allocations when either prefix or key is empty.
167func joinPrefix(prefix, key string) string {
168 if prefix == "" {
169 return key
170 }
171 if key == "" {
172 return prefix
173 }
174 return prefix + "." + key
175}
176
177// appendSlogAttr appends a single slog.Attr to the zerolog event, handling
178// type-specific encoding to avoid reflection where possible.

Callers 1

appendSlogAttrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected