MCPcopy
hub / github.com/valyala/quicktemplate / emitFuncEnd

Method emitFuncEnd

parser/parser.go:788–809  ·  view source on GitHub ↗
(f *funcType)

Source from the content-addressed store, hash-verified

786}
787
788func (p *parser) emitFuncEnd(f *funcType) {
789 p.prefix = ""
790 p.Printf("}\n")
791
792 p.Printf("func %s {", f.DefWrite("qq"+mangleSuffix))
793 p.prefix = "\t"
794 p.Printf("qw%s := qt%s.AcquireWriter(qq%s)", mangleSuffix, mangleSuffix, mangleSuffix)
795 p.Printf("%s", f.CallStream("qw"+mangleSuffix))
796 p.Printf("qt%s.ReleaseWriter(qw%s)", mangleSuffix, mangleSuffix)
797 p.prefix = ""
798 p.Printf("}\n")
799
800 p.Printf("func %s {", f.DefString())
801 p.prefix = "\t"
802 p.Printf("qb%s := qt%s.AcquireByteBuffer()", mangleSuffix, mangleSuffix)
803 p.Printf("%s", f.CallWrite("qb"+mangleSuffix))
804 p.Printf("qs%s := string(qb%s.B)", mangleSuffix, mangleSuffix)
805 p.Printf("qt%s.ReleaseByteBuffer(qb%s)", mangleSuffix, mangleSuffix)
806 p.Printf("return qs%s", mangleSuffix)
807 p.prefix = ""
808 p.Printf("}\n")
809}
810
811func (p *parser) Printf(format string, args ...interface{}) {
812 if p.skipOutputDepth > 0 {

Callers 1

parseFuncMethod · 0.95

Calls 5

PrintfMethod · 0.95
DefWriteMethod · 0.80
CallStreamMethod · 0.80
DefStringMethod · 0.80
CallWriteMethod · 0.80

Tested by

no test coverage detected