// Load parses lines of a reader in the .env format.
518803
func Load(reader io.Reader) (Env, error) {
	r := bufio.NewReader(reader)
	env := make(map[string]string)

	for {
		line, _, err := r.ReadLine()
		if err != nil {
			break
		}

		key, val, err := parseln(string(line))
		if err != nil {
			return env, err
		}

		env[key] = val
		os.Setenv(key, val)
	}

	return env, nil
}
740586
func (c *BuildConfig) Load(file string) error {
	data, err := ioutil.ReadFile(file)

	if err != nil {
		log.Printf("Unable to ReadConfig File: %s -> %s", file, err.Error())
		return err
	}

	conf := BuildConfig{}
	err = yaml.Unmarshal(data, &conf)

	if err != nil {
		log.Printf("Unable to load Config File: %s -> %s", file, err.Error())
		return err
	}

	if conf.Package == "" {
		return errors.New("package option can not be empty, provide the project package name please")
	}

	if err := mergo.MergeWithOverwrite(c, conf); err != nil {
		return err
	}

	if mano, err := strconv.ParseBool(c.UseMain); err == nil {
		c.GoMain = mano
	}

	if vbo, err := strconv.ParseBool(c.Client.Verbose); err == nil {
		c.Client.UseVerbose = vbo
	}

	if doge, err := strconv.ParseBool(c.DoGoGet); err == nil {
		c.Goget = doge
	}

	c.ClientPackage = filepath.Join(c.Package, "client")

	if strings.Contains(c.ClientPackage, `\`) {
		c.ClientPackage = filepath.ToSlash(c.ClientPackage)
	}

	env := strings.ToLower(c.Env)

	if !strings.Contains(env, "dev") && !strings.Contains(env, "development") && !strings.Contains(env, "debug") {
		c.Mode = 1
	}

	return nil
}
177667
func Load(r io.Reader) (*DotSql, error) {
	scanner := &Scanner{}
	queries := scanner.Run(bufio.NewScanner(r))

	dotsql := &DotSql{
		queries: queries,
	}

	return dotsql, nil
}
182251
func (c *edgeCollection) Load(ctx context.Context) error {
	if err := c.rawCollection().Load(ctx); err != nil {
		return WithStack(err)
	}
	return nil
}
599017
func (t *tmxLoader) Load(url string, data io.Reader) error {
	lvl, err := createLevelFromTmx(data, url)
	if err != nil {
		return err
	}

	t.levels[url] = TMXResource{Level: lvl, url: url}
	return nil
}
333338
func Load(content string) (tree *Tree, err error) {
	return LoadBytes([]byte(content))
}
261515
func Load(path string, v interface{}) error {
	lock.Lock()
	defer lock.Unlock()
	f, err := os.Open(path)
	if err != nil {
		return err
	}
	defer f.Close()
	return Unmarshal(f, v)
}
531500
func (env *Glisp) LoadStream(stream io.Reader) error {
	expressions, err := env.ParseStream(stream)

	if err != nil {
		return err
	}

	return env.LoadExpressions(expressions)
}
856632
func (rd *reservoirReader) load(n int) error {
	m, err := rd.stream.readBytes(rd.buffer[rd.limit : rd.limit+n])
	rd.limit += m
	return err
}
171257
func (c *config) load() error {
	path, err := c.path()
	if err != nil {
		return nil
	}
	return c.loadFromPath(path)
}
890288
func (f *File) Load() (*Config, error) {
	var err error
	if !utils.Exists(f.FilePath) {
		return nil, errors.New("Error: I Can't find the config file at [" + f.FilePath + "]")
	}

	// read file
	f.Data, err = ioutil.ReadFile(f.FilePath)
	if err != nil {
		return nil, err
	}

	// parse file
	return f.Parse()
}
1358887
func (c *ConfigFile) Load() error {
	rw, err := NewConfigReadWriter(c.version)
	if err != nil {
		return err
	}
	filename := rw.Filename(c)
	if _, err := os.Stat(filename); err != nil {
		return err
	}
	file, err := os.Open(filename)
	if err != nil {
		return err
	}
	err = rw.LoadFromReader(file, c)
	if err != nil {
		return err
	}
	defer file.Close()
	return nil
}
725885
func (cfg *Config) load(storage util.Storage) {
	if b, err := storage.Get("uuid"); err == nil && len(b) > 0 {
		cfg.id = string(b)
	}

	if b, err := storage.Get("version"); err == nil && len(b) > 0 {
		cfg.version = to.Int64(string(b))
	}

	if b, err := storage.Get("configHash"); err == nil && len(b) > 0 {
		cfg.configHash = b
	}
}
1309268
func Load(config interface{}, defaultValue interface{}, args []string) error {
	return LoadWithParsers(config, defaultValue, args, nil)
}
836278
func (a *audioLoader) Load(url string, data io.Reader) error {
	var err error
	audioBytes, err := ioutil.ReadAll(data)
	if err != nil {
		return err
	}

	audioBuffer := bytes.NewReader(audioBytes)

	var player *Player
	switch getExt(url) {
	case ".wav":
		d, err := wav.Decode(&readSeekCloserBuffer{audioBuffer}, SampleRate)
		if err != nil {
			return err
		}

		player, err = newPlayer(d, url)
		if err != nil {
			return err
		}
	case ".mp3":
		d, err := mp3.Decode(&readSeekCloserBuffer{audioBuffer}, SampleRate)
		if err != nil {
			return err
		}

		player, err = newPlayer(d, url)
		if err != nil {
			return err
		}
	case ".ogg":
		d, err := vorbis.Decode(&readSeekCloserBuffer{audioBuffer}, SampleRate)
		if err != nil {
			return err
		}

		player, err = newPlayer(d, url)
		if err != nil {
			return err
		}
	}

	a.audios[url] = player
	return nil
}
773644
func (prog *Program) Load(i int) (string, syntax.Position) {
	id := prog.compiled.Loads[i]
	return id.Name, id.Pos
}
21472
func Load(set *FIFOSet) (IO, error) {
	return &cio{
		config:  set.Config,
		closers: []io.Closer{set},
	}, nil
}