MCPcopy
hub / github.com/sqlc-dev/sqlc / Format

Method Format

internal/sql/ast/case_expr.go:19–34  ·  view source on GitHub ↗
(buf *TrackedBuffer, d format.Dialect)

Source from the content-addressed store, hash-verified

17}
18
19func (n *CaseExpr) Format(buf *TrackedBuffer, d format.Dialect) {
20 if n == nil {
21 return
22 }
23 buf.WriteString("CASE ")
24 if set(n.Arg) {
25 buf.astFormat(n.Arg, d)
26 buf.WriteString(" ")
27 }
28 buf.join(n.Args, d, " ")
29 if set(n.Defresult) {
30 buf.WriteString(" ELSE ")
31 buf.astFormat(n.Defresult, d)
32 }
33 buf.WriteString(" END")
34}

Callers

nothing calls this directly

Calls 3

setFunction · 0.85
astFormatMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected