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

Method WithAnnotations

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

WithAnnotations modifies FmtCtx to use the provided Annotations, calls fn, then restores the original ones.

(ann *Annotations, fn func())

Source from the content-addressed store, hash-verified

471// WithAnnotations modifies FmtCtx to use the provided Annotations, calls fn,
472// then restores the original ones.
473func (ctx *FmtCtx) WithAnnotations(ann *Annotations, fn func()) {
474 defer func(oldAnn *Annotations) {
475 ctx.ann = oldAnn
476 }(ctx.ann)
477 ctx.ann = ann
478
479 fn()
480}
481
482// HasFlags returns true iff all of the given flags are set in the formatter
483// context.

Callers 6

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