xslate.go
func (tx *Xslate) RenderString(template string, vars Vars) (string, error) {
	_, file, line, _ := runtime.Caller(1)
	bc, err := tx.Loader.LoadString(fmt.Sprintf("%s:%d", file, line), template)
	if err != nil {
		return "", errors.Wrap(err, "failed to parse template string")
	}

	buf := rbpool.Get()
	defer rbpool.Release(buf)

	tx.VM.Run(bc, vm.Vars(vars), buf)
	return buf.String(), nil
}
func (tx *Xslate) RenderString(template string, vars Vars) (string, error) {
	_, file, line, _ := runtime.Caller(1)
	bc, err := tx.Loader.LoadString(fmt.Sprintf("%s:%d", file, line), template)
	if err != nil {
		return "", errors.Wrap(err, "failed to parse template string")
	}

	buf := rbpool.Get()
	defer rbpool.Release(buf)

	tx.VM.Run(bc, vm.Vars(vars), buf)
	return buf.String(), nil
}
// RenderString takes a string argument and treats it as the template
// content. Like `Render()`, this template is parsed and compiled. Because
// there's no way to establish template "freshness", the resulting bytecode
// from `RenderString()` is not cached for reuse.
//
// If you *really* want to change this behavior, it's not impossible to
// bend Xslate's Loader mechanism to cache strings as well, but the main
// Xslate library will probably not adopt this feature.