MCPcopy
hub / github.com/uber-go/zap / Stringp

Function Stringp

field.go:228–233  ·  view source on GitHub ↗

Stringp constructs a field that carries a *string. The returned Field will safely and explicitly represent `nil` when appropriate.

(key string, val *string)

Source from the content-addressed store, hash-verified

226// Stringp constructs a field that carries a *string. The returned Field will safely
227// and explicitly represent `nil` when appropriate.
228func Stringp(key string, val *string) Field {
229 if val == nil {
230 return nilField(key)
231 }
232 return String(key, *val)
233}
234
235// Uint constructs a field with the given key and value.
236func Uint(key string, val uint) Field {

Callers 1

TestFieldConstructorsFunction · 0.85

Calls 2

nilFieldFunction · 0.85
StringFunction · 0.85

Tested by 1

TestFieldConstructorsFunction · 0.68