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

Function encodeTimeLayout

zapcore/encoder.go:123–134  ·  view source on GitHub ↗
(t time.Time, layout string, enc PrimitiveArrayEncoder)

Source from the content-addressed store, hash-verified

121}
122
123func encodeTimeLayout(t time.Time, layout string, enc PrimitiveArrayEncoder) {
124 type appendTimeEncoder interface {
125 AppendTimeLayout(time.Time, string)
126 }
127
128 if enc, ok := enc.(appendTimeEncoder); ok {
129 enc.AppendTimeLayout(t, layout)
130 return
131 }
132
133 enc.AppendString(t.Format(layout))
134}
135
136// ISO8601TimeEncoder serializes a time.Time to an ISO8601-formatted string
137// with millisecond precision.

Callers 4

ISO8601TimeEncoderFunction · 0.85
RFC3339TimeEncoderFunction · 0.85
RFC3339NanoTimeEncoderFunction · 0.85
TimeEncoderOfLayoutFunction · 0.85

Calls 3

AppendTimeLayoutMethod · 0.65
AppendStringMethod · 0.65
FormatMethod · 0.45

Tested by

no test coverage detected