MCPcopy
hub / github.com/gin-gonic/gin / Encode

Method Encode

binding/json_test.go:138–145  ·  view source on GitHub ↗
(ptr unsafe.Pointer, stream *jsoniter.Stream)

Source from the content-addressed store, hash-verified

136}
137
138func (tc timeCodec) Encode(ptr unsafe.Pointer, stream *jsoniter.Stream) {
139 t := *((*time.Time)(ptr))
140 if t.Equal(zeroTime) {
141 stream.WriteNil()
142 return
143 }
144 stream.WriteString(t.In(time.Local).Format("2006-01-02 15:04:05.000"))
145}
146
147func (tc timeCodec) Decode(ptr unsafe.Pointer, iter *jsoniter.Iterator) {
148 ts := iter.ReadString()

Callers

nothing calls this directly

Calls 1

WriteStringMethod · 0.65

Tested by

no test coverage detected