code: func (s *Engine) LoadAssets(virtualDirectory string, virtualExtension string, assetFn func(name string) ([]byte, error), namesFn func() []string) error {
  	var templateErr error
  	s.Templates = template.New(virtualDirectory)
  	s.Templates.Delims(s.Config.Left, s.Config.Right)
  	names := namesFn()
  	if len(virtualDirectory) > 0 {
  		if virtualDirectory[0] == '.' { // first check for .wrong
  			virtualDirectory = virtualDirectory[1:]
  		}
  		if virtualDirectory[0] == '/' || virtualDirectory[0] == os.PathSeparator { // second check for /something, (or ./something if we had dot on 0 it will be removed
  			virtualDirectory = virtualDirectory[1:]
  		}
  	}
  
  	for _, path := range names {
  		if !strings.HasPrefix(path, virtualDirectory) {
  			continue
  		}
  		ext := filepath.Ext(path)
  		if ext == virtualExtension {
  
  			rel, err := filepath.Rel(virtualDirectory, path)
  			if err != nil {
  				templateErr = err
  				return err
  			}
  
  			buf, err := assetFn(path)
  			if err != nil {
  				templateErr = err
  				return err
  			}
  			contents := string(buf)
  			name := filepath.ToSlash(rel)
  			tmpl := s.Templates.New(name)
  
  			if s.Middleware != nil {
  				contents, err = s.Middleware(name, contents)
  			}
  			if err != nil {
  				templateErr = err
  				return err
  			}
  
  			// Add our funcmaps.
  			if s.Config.Funcs != nil {
  				tmpl.Funcs(s.Config.Funcs)
  			}
  
  			tmpl.Funcs(emptyFuncs).Parse(contents)
  		}
  	}
  	return templateErr
  }
docs: // LoadAssets loads the templates by binary