(val time.Duration)
| 263 | } |
| 264 | |
| 265 | func (enc *jsonEncoder) AppendDuration(val time.Duration) { |
| 266 | cur := enc.buf.Len() |
| 267 | if e := enc.EncodeDuration; e != nil { |
| 268 | e(val, enc) |
| 269 | } |
| 270 | if cur == enc.buf.Len() { |
| 271 | // User-supplied EncodeDuration is a no-op. Fall back to nanoseconds to keep |
| 272 | // JSON valid. |
| 273 | enc.AppendInt64(int64(val)) |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | func (enc *jsonEncoder) AppendInt64(val int64) { |
| 278 | enc.addElementSeparator() |
no test coverage detected