MCPcopy Index your code
hub / github.com/tinylib/msgp / AppendTime

Function AppendTime

msgp/write_bytes.go:316–324  ·  view source on GitHub ↗

AppendTime appends a time.Time to the slice as a MessagePack extension

(b []byte, t time.Time)

Source from the content-addressed store, hash-verified

314
315// AppendTime appends a time.Time to the slice as a MessagePack extension
316func AppendTime(b []byte, t time.Time) []byte {
317 o, n := ensure(b, TimeSize)
318 t = t.UTC()
319 o[n] = mext8
320 o[n+1] = 12
321 o[n+2] = TimeExtension
322 putUnix(o[n+3:], t.Unix(), int32(t.Nanosecond()))
323 return o
324}
325
326// AppendTimeExt will write t using the official msgpack extension spec.
327// https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type

Callers 6

BenchmarkReadTimeBytesFunction · 0.85
BenchmarkReadTimeFunction · 0.85
AppendIntfFunction · 0.85
TestRawFunction · 0.85
BenchmarkAppendTimeFunction · 0.85

Calls 2

putUnixFunction · 0.85
ensureFunction · 0.70

Tested by 5

BenchmarkReadTimeBytesFunction · 0.68
BenchmarkReadTimeFunction · 0.68
TestRawFunction · 0.68
BenchmarkAppendTimeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…