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

Function TimeEncoderOfLayout

zapcore/encoder.go:164–168  ·  view source on GitHub ↗

TimeEncoderOfLayout returns TimeEncoder which serializes a time.Time using given layout.

(layout string)

Source from the content-addressed store, hash-verified

162// TimeEncoderOfLayout returns TimeEncoder which serializes a time.Time using
163// given layout.
164func TimeEncoderOfLayout(layout string) TimeEncoder {
165 return func(t time.Time, enc PrimitiveArrayEncoder) {
166 encodeTimeLayout(t, layout, enc)
167 }
168}
169
170// UnmarshalText unmarshals text to a TimeEncoder.
171// "rfc3339nano" and "RFC3339Nano" are unmarshaled to RFC3339NanoTimeEncoder.

Callers 1

UnmarshalYAMLMethod · 0.85

Calls 1

encodeTimeLayoutFunction · 0.85

Tested by

no test coverage detected