FormatDuration writes d into ctx according to the format flags.
(d duration.Duration, ctx *FmtCtx)
| 3268 | |
| 3269 | // FormatDuration writes d into ctx according to the format flags. |
| 3270 | func FormatDuration(d duration.Duration, ctx *FmtCtx) { |
| 3271 | f := ctx.flags |
| 3272 | bareStrings := f.HasFlags(FmtFlags(lexbase.EncBareStrings)) |
| 3273 | if !bareStrings { |
| 3274 | ctx.WriteByte('\'') |
| 3275 | } |
| 3276 | d.FormatWithStyle(&ctx.Buffer, ctx.dataConversionConfig.IntervalStyle) |
| 3277 | if !bareStrings { |
| 3278 | ctx.WriteByte('\'') |
| 3279 | } |
| 3280 | } |
| 3281 | |
| 3282 | // Format implements the NodeFormatter interface. |
| 3283 | func (d *DInterval) Format(ctx *FmtCtx) { |
no test coverage detected
searching dependent graphs…