MCPcopy Create free account
hub / github.com/goccy/go-yaml / encodeTime

Method encodeTime

encode.go:839–845  ·  view source on GitHub ↗
(v time.Time, column int)

Source from the content-addressed store, hash-verified

837}
838
839func (e *Encoder) encodeTime(v time.Time, column int) *ast.StringNode {
840 value := v.Format(time.RFC3339Nano)
841 if e.isJSONStyle {
842 value = strconv.Quote(value)
843 }
844 return ast.String(token.New(value, value, e.pos(column)))
845}
846
847func (e *Encoder) encodeDuration(v time.Duration, column int) *ast.StringNode {
848 value := v.String()

Callers 2

encodeByMarshalerMethod · 0.95
encodeValueMethod · 0.95

Calls 3

posMethod · 0.95
StringFunction · 0.92
NewFunction · 0.92

Tested by

no test coverage detected