MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / WithFlags

Method WithFlags

pkg/sql/sem/tree/format.go:448–457  ·  view source on GitHub ↗

WithFlags changes the flags in the FmtCtx, runs the given function, then restores the old flags.

(flags FmtFlags, fn func())

Source from the content-addressed store, hash-verified

446// WithFlags changes the flags in the FmtCtx, runs the given function, then
447// restores the old flags.
448func (ctx *FmtCtx) WithFlags(flags FmtFlags, fn func()) {
449 if ctx.ann == nil && flags&flagsRequiringAnnotations != 0 {
450 panic(errors.AssertionFailedf("no Annotations provided"))
451 }
452 oldFlags := ctx.flags
453 ctx.flags = flags
454 defer func() { ctx.flags = oldFlags }()
455
456 fn()
457}
458
459// WithoutConstantRedaction modifies FmtCtx to ensure that constants are
460// displayed rather than being replaced by '_', calls fn, then restores the

Callers 13

formatEachMethod · 0.80
FormatMethod · 0.80
FormatMethod · 0.80
FormatMethod · 0.80
FormatMethod · 0.80
FormatMethod · 0.80
FormatMethod · 0.80
FormatMethod · 0.80
FormatMethod · 0.80
FormatMethod · 0.80
FormatMethod · 0.80
FormatMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected