Format implements the NodeFormatter interface.
(ctx *FmtCtx)
| 385 | |
| 386 | // Format implements the NodeFormatter interface. |
| 387 | func (d *DInt) Format(ctx *FmtCtx) { |
| 388 | // If the number is negative, we need to use parens or the `:::INT` type hint |
| 389 | // will take precedence over the negation sign. |
| 390 | disambiguate := ctx.flags.HasFlags(fmtDisambiguateDatumTypes) |
| 391 | parsable := ctx.flags.HasFlags(FmtParsableNumerics) |
| 392 | needParens := (disambiguate || parsable) && *d < 0 |
| 393 | if needParens { |
| 394 | ctx.WriteByte('(') |
| 395 | } |
| 396 | ctx.WriteString(strconv.FormatInt(int64(*d), 10)) |
| 397 | if needParens { |
| 398 | ctx.WriteByte(')') |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | // Size implements the Datum interface. |
| 403 | func (d *DInt) Size() uintptr { |
nothing calls this directly
no test coverage detected