template.go
func ExecuteFuncString(template, startTag, endTag string, f TagFunc) string {
	tagsCount := bytes.Count(unsafeString2Bytes(template), unsafeString2Bytes(startTag))
	if tagsCount == 0 {
		return template
	}

	bb := byteBufferPool.Get()
	if _, err := ExecuteFunc(template, startTag, endTag, bb, f); err != nil {
		panic(fmt.Sprintf("unexpected error: %s", err))
	}
	s := string(bb.B)
	bb.Reset()
	byteBufferPool.Put(bb)
	return s
}
func ExecuteFuncString(template, startTag, endTag string, f TagFunc) string {
	tagsCount := bytes.Count(unsafeString2Bytes(template), unsafeString2Bytes(startTag))
	if tagsCount == 0 {
		return template
	}

	bb := byteBufferPool.Get()
	if _, err := ExecuteFunc(template, startTag, endTag, bb, f); err != nil {
		panic(fmt.Sprintf("unexpected error: %s", err))
	}
	s := string(bb.B)
	bb.Reset()
	byteBufferPool.Put(bb)
	return s
}
func ExecuteFuncString ( template , startTag , endTag string , f TagFunc ) string { tagsCount := bytes . Count ( unsafeString2Bytes ( template ) , unsafeString2Bytes ( startTag ) ) if tagsCount == 0 { return template } bb := byteBufferPool . Get ( ) if _ , err := ExecuteFunc ( template , startTag , endTag , bb , f ) ; err != nil { panic ( fmt . Sprintf ( " " , err ) ) } s := string ( bb . B ) bb . Reset ( ) byteBufferPool . Put ( bb ) return s }
// ExecuteFuncString calls f on each template tag (placeholder) occurrence
// and substitutes it with the data written to TagFunc's w.
//
// Returns the resulting string.
//
// This function is optimized for constantly changing templates.
// Use Template.ExecuteFuncString for frozen templates.
ExecuteFuncString calls f on each template tag ( placeholder ) occurrence and substitutes it with the data written to TagFunc s w . Returns the resulting string . This function is optimized for constantly changing templates . Use Template . ExecuteFuncString for frozen templates .