ace.go
func Load(basePath, innerPath string, opts *Options) (*template.Template, error) {
	// Initialize the options.
	opts = InitializeOptions(opts)

	name := basePath + colon + innerPath

	if !opts.DynamicReload {
		if tpl, ok := getCache(name); ok {
			return &tpl, nil
		}
	}

	// Read files.
	src, err := readFiles(basePath, innerPath, opts)
	if err != nil {
		return nil, err
	}

	// Parse the source.
	rslt, err := ParseSource(src, opts)
	if err != nil {
		return nil, err
	}

	// Compile the parsed result.
	tpl, err := CompileResult(name, rslt, opts)
	if err != nil {
		return nil, err
	}

	if !opts.DynamicReload {
		setCache(name, *tpl)
	}

	return tpl, nil
}
func Load(basePath, innerPath string, opts *Options) (*template.Template, error) {
	// Initialize the options.
	opts = InitializeOptions(opts)

	name := basePath + colon + innerPath

	if !opts.DynamicReload {
		if tpl, ok := getCache(name); ok {
			return &tpl, nil
		}
	}

	// Read files.
	src, err := readFiles(basePath, innerPath, opts)
	if err != nil {
		return nil, err
	}

	// Parse the source.
	rslt, err := ParseSource(src, opts)
	if err != nil {
		return nil, err
	}

	// Compile the parsed result.
	tpl, err := CompileResult(name, rslt, opts)
	if err != nil {
		return nil, err
	}

	if !opts.DynamicReload {
		setCache(name, *tpl)
	}

	return tpl, nil
}
func Load ( basePath , innerPath string , opts * Options ) ( * template . Template , error ) { // Initialize the options. opts = InitializeOptions ( opts ) name := basePath + colon + innerPath if ! opts . DynamicReload { if tpl , ok := getCache ( name ) ; ok { return & tpl , nil } } // Read files. src , err := readFiles ( basePath , innerPath , opts ) if err != nil { return nil , err } // Parse the source. rslt , err := ParseSource ( src , opts ) if err != nil { return nil , err } // Compile the parsed result. tpl , err := CompileResult ( name , rslt , opts ) if err != nil { return nil , err } if ! opts . DynamicReload { setCache ( name , * tpl ) } return tpl , nil }
// Load loads and returns an HTML template. Each Ace templates are parsed only once
// and cached if the "DynamicReload" option are not set.
Load loads and returns an HTML template . Each Ace templates are parsed only once and cached if the DynamicReload option are not set .