// loading is the asynchronous loading function.
177759
func loading(c *cache, id string) {
	cacheable, err := c.load(id)
	if err != nil {
		c.taskc <- failedTask(id, err)
	} else {
		c.taskc <- successTask(id, cacheable)
	}
}
755642
func (l *fsLoader) Load(ep *transport.Endpoint) (storer.Storer, error) {
	fs, err := l.base.Chroot(ep.Path)
	if err != nil {
		return nil, err
	}

	if _, err := fs.Stat("config"); err != nil {
		return nil, transport.ErrRepositoryNotFound
	}

	return filesystem.NewStorage(fs, cache.NewObjectLRUDefault()), nil
}
320490
func (s *Script) Load(c Conn) error {
	_, err := c.Do("SCRIPT", "LOAD", s.src)
	return err
}
647824
func (loader *TemplateLoader) Load(fs filesystem.Filespace, subPath string) error {
	bytes, err := fs.ReadFile(subPath)
	if err != nil {
		return err
	}
	loader.muTemplate.Lock()
	defer loader.muTemplate.Unlock()
	if len(bytes) == 0 {
		return fmt.Errorf("empty file")
	}
	if _, err := loader.template.Parse(string(bytes)); err != nil {
		return fmt.Errorf("%v: %v", subPath, err)
	}
	return nil
}
1002616
func (d config) Load(filename string) error {
	d.lock.Lock()
	defer d.lock.Unlock()
	if d.clnt != nil {
		return loadFileConfigEtcd(filename, d.clnt, d.data)
	}
	return loadFileConfig(filename, d.data)
}
812521
func Load(fs filesystem.Filespace, basePath string, i18 i18n.I18N, scope app.Scope) error {
	loop := fsloop.NewLoop(&fsloop.LoopData{
		Filespace: fs,
		FileFilter: func(fs filesystem.Filespace, subPath string) bool {
			return strings.HasSuffix(subPath, ".json")
		},
		OnFile: func(fs filesystem.Filespace, subPath string) error {
			data, err := fs.ReadFile(subPath)
			if err != nil {
				return err
			}
			tmap, err := plainmap.JSONToPlainStringMap(data)
			if err != nil {
				return err
			}
			i18.Set(tmap)
			return nil
		},
	}, scope)
	loop.Run(basePath)
	loop.Wait()
	if errs := loop.Errors(); len(errs) != 0 {
		return goaterr.NewErrors(errs)
	}
	return nil
}
549929
func Load(qw graph.QuadWriter, batch int, path, typ string) error {
	return DecompressAndLoad(qw, batch, path, typ, nil)
}
444761
func (c *Connection) Load(names ...string) (errors []error) {
	var tempErrors []error = make([]error, len(names))
	var numErrors int = 0
	for _, name := range names {
		err := c.Create(name)
		if err != nil {
			tempErrors = append(tempErrors, err)
			numErrors += 1
			continue
		}
		break
	}

	copy(errors, tempErrors[0:numErrors])
	return
}
1018779
func (l *propertiesLoader) Load(out interface{}) error {
	properties := make(p.Properties)
	if err := properties.Load(l.r); err != nil {
		return err
	}
	o := out.(*map[string]string)
	*o = map[string]string(properties)
	return nil
}
412312
func (f *FlagLoader) Load(s interface{}) error {
	strct := structs.New(s)
	structName := strct.Name()

	flagSet := flag.NewFlagSet(structName, f.ErrorHandling)
	f.flagSet = flagSet

	for _, field := range strct.Fields() {
		f.processField(field.Name(), field)
	}

	flagSet.Usage = func() {
		fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
		flagSet.PrintDefaults()
		fmt.Fprintf(os.Stderr, "\nGenerated environment variables:\n")
		e := &EnvironmentLoader{
			Prefix:    f.EnvPrefix,
			CamelCase: f.CamelCase,
		}
		e.PrintEnvs(s)
		fmt.Println("")
	}

	args := filterArgs(os.Args[1:])
	if f.Args != nil {
		args = f.Args
	}

	return flagSet.Parse(args)
}
610638
func (ls *LState) Load(reader io.Reader, name string) (*LFunction, error) {
	chunk, err := parse.Parse(reader, name)
	if err != nil {
		return nil, newApiErrorE(ApiErrorSyntax, err)
	}
	proto, err := Compile(chunk, name)
	if err != nil {
		return nil, newApiErrorE(ApiErrorSyntax, err)
	}
	return newLFunctionL(proto, ls.currentEnv(), 0), nil
}
583952
func Load(in io.Reader) (File, error) {
	file := make(File)
	err := file.Load(in)
	return file, err
}
538471
func (c compiler) load(p string) (*Module, error) {
	p, err := c.fs.Abs(p)
	if err != nil {
		return nil, err
	}

	if m, ok := c.Modules[p]; ok {
		// Already loaded.
		return m, nil
	}

	s, err := c.fs.Read(p)
	if err != nil {
		return nil, fileReadError{Path: p, Reason: err}
	}

	prog, err := idl.Parse(s)
	if err != nil {
		return nil, parseError{Path: p, Reason: err}
	}

	m := &Module{
		Name:       fileBaseName(p),
		ThriftPath: p,
		Includes:   make(map[string]*IncludedModule),
		Constants:  make(map[string]*Constant),
		Types:      make(map[string]TypeSpec),
		Services:   make(map[string]*ServiceSpec),
	}

	m.Raw = s
	c.Modules[p] = m
	// the module is added to the map before processing includes to break
	// cyclic includes.

	if err := c.gather(m, prog); err != nil {
		return nil, fileCompileError{Path: p, Reason: err}
	}
	return m, nil
}
515618
func (k *Keyfile) Load() (err error) {
	if len(k.fname) > 0 {
		var f *os.File
		f, err = os.Open(k.fname)
		if err == nil {
			err = k.read(f)
			f.Close()
		}
	}
	return
}
931122
func Load(configFile string, data interface{}) (quick.Config, error) {
	return quick.LoadConfig(configFile, globalEtcdClient, data)
}
702616
func (m *resolversMap) Load(key string) (resolver.Resolver, bool) {
	i, ok := m.data.Load(key)
	if !ok {
		return nil, false
	}
	s, ok := i.(resolver.Resolver)
	return s, ok
}
789824
func (ms *MatStack) Load(m mgl32.Mat4) {
	(*ms)[len(*ms)-1] = m
}