// loadAssets loads the templates by binary, embedded.
496688
func (s *HandlebarsEngine) loadAssets() error {
	// register the global helpers
	if len(s.templateCache) == 0 && s.helpers != nil {
		raymond.RegisterHelpers(s.helpers)
	}

	virtualDirectory, virtualExtension := s.directory, s.extension
	assetFn, namesFn := s.assetFn, s.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:]
		}
	}
	var templateErr error

	names := namesFn()
	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, err := raymond.Parse(contents)
			if err != nil {
				templateErr = err
				return err
			}
			s.templateCache[name] = tmpl

		}
	}
	return templateErr
}
210363
func (cfg *TLSConfig) LoadBytes() error {
	var err error
	if cfg.Pem != "" {
		cfg.bytes = []byte(cfg.Pem)
	} else if cfg.Path != "" {
		cfg.bytes, err = ioutil.ReadFile(cfg.Path)
		if err != nil {
			return errors.Wrapf(err, "failed to load pem bytes from path %s", cfg.Path)
		}
	}
	return nil
}
493205
func (c *Config) LoadAll() (bool, error) {
	c.lock.Lock()
	defer c.lock.Unlock()

	return c.MergeLoaders(c.loaders...)
}
1164
func (s *baseConversationSource) DeleteAssets(ctx context.Context, uid gregor1.UID,
	convID chat1.ConversationID, assets []chat1.Asset) {
	defer s.Trace(ctx, func() error { return nil }, "DeleteAssets: %v", assets)()

	if len(assets) == 0 {
		return
	}

	// Fire off a background load of the thread with a post hook to delete the bodies cache
	s.G().ConvLoader.Queue(ctx, types.NewConvLoaderJob(convID, nil /*query*/, nil /*pagination*/, types.ConvLoaderPriorityHigh,
		func(ctx context.Context, tv chat1.ThreadView, job types.ConvLoaderJob) {
			fetcher := s.G().AttachmentURLSrv.GetAttachmentFetcher()
			if err := fetcher.DeleteAssets(ctx, convID, assets, s.ri, s); err != nil {
				s.Debug(ctx, "Error purging ephemeral attachments %v", err)
			}
		}))
}
607178
func (s *Finding) SetAssetAttributes(v *AssetAttributes) *Finding {
	s.AssetAttributes = v
	return s
}
1044009
func (c *ChainIndexer) loadValidSections() {
	data, _ := c.indexDb.Get([]byte("count"))
	if len(data) == 8 {
		c.storedSections = binary.BigEndian.Uint64(data)
	}
}
695611
func (g *Generator) loadPackage(path string) (*loader.PackageInfo, error) {
	pkg := g.Program.Package(path)
	if pkg != nil {
		return pkg, nil
	}

	return nil, fmt.Errorf("failed to load package %q", path)
}
677899
func (s *DefaultService) LoadAllowNondistributableArtifacts(registries []string) error {
	s.mu.Lock()
	defer s.mu.Unlock()

	return s.config.LoadAllowNondistributableArtifacts(registries)
}
738169
func LoadDollarTemplates(t TouchID, src *RWops) int {
	return int(C.SDL_LoadDollarTemplates(t.c(), src.cptr()))
}
1363247
func NewBinDataAsset(assetName, targetDir, targetName, permissions string, isTemplate bool) *BinDataAsset {
	m := &BinDataAsset{
		BaseAsset: BaseAsset{
			AssetName:   assetName,
			TargetDir:   targetDir,
			TargetName:  targetName,
			Permissions: permissions,
		},
		template: nil,
	}
	m.loadData(isTemplate)
	return m
}
518759
func AddTemplates(files ...string) Option {
	return func(r *Renderer) error {
		if len(files) == 0 {
			return errors.New("render: no templates passed")
		}
		r.templateFiles = files
		return nil
	}
}
829748
func LoadCachedImagesInConfigFile() error {
	images, err := imagesInConfigFile()
	if err != nil {
		return err
	}
	if len(images) == 0 {
		return nil
	}
	return machine.CacheAndLoadImages(images)
}
1310143
func init() {
	for _, file := range tracers.AssetNames() {
		name := camel(strings.TrimSuffix(file, ".js"))
		all[name] = string(tracers.MustAsset(file))
	}
}
640408
func (ut *URLTransformer) LoadPaths(paths []string) error {
	for _, path := range paths {
		err := ut.LoadPath(path)
		if err != nil {
			return err
		}
	}
	return nil
}
261411
func (t *BinaryLoader) Binary(assetFn func(name string) ([]byte, error), namesFn func() []string) {
	if assetFn == nil || namesFn == nil {
		return
	}

	t.AssetFn = assetFn
	t.NamesFn = namesFn
	// if extension is not static(setted by .Directory)
	if t.Extension == "" {
		if names := namesFn(); len(names) > 0 {
			t.Extension = filepath.Ext(names[0]) // we need the extension to get the correct template engine on the Render method
		}
	}
}
720925
func LoadImages(cmd bootstrapper.CommandRunner, images []string, cacheDir string) error {
	var g errgroup.Group
	// Load profile cluster config from file
	cc, err := config.Load()
	if err != nil && !os.IsNotExist(err) {
		glog.Errorln("Error loading profile config: ", err)
	}
	for _, image := range images {
		image := image
		g.Go(func() error {
			src := filepath.Join(cacheDir, image)
			src = sanitizeCacheDir(src)
			if err := loadImageFromCache(cmd, cc.KubernetesConfig, src); err != nil {
				glog.Warningf("Failed to load %s: %v", src, err)
				return errors.Wrapf(err, "loading image %s", src)
			}
			return nil
		})
	}
	if err := g.Wait(); err != nil {
		return errors.Wrap(err, "loading cached images")
	}
	glog.Infoln("Successfully loaded all cached images.")
	return nil
}
149831
func (t *Loader) LoadEngine(e Engine) error {
	if t.Dir == "" {
		return errMissingDirectoryOrAssets
	}

	if t.IsBinary() {
		// don't try to put abs path here
		// fixes: http://support.iris-go.com/d/22-template-binary-problem-in-v6
		return e.LoadAssets(t.Dir, t.Extension, t.AssetFn, t.NamesFn)
	}

	// fixes when user tries to execute the binary from a temp location while the templates are relatively located
	absDir, err := filepath.Abs(t.Dir)
	// panic here of course.
	if err != nil {
		panic("couldn't find the dir in the relative dir: '" + t.Dir +
			"' neither as absolute: '" + absDir + "'\n" + err.Error())
	}
	return e.LoadDirectory(absDir, t.Extension)
}