config/env/env.go
func _MSet(filename string, keys, values []string) error {
	if len(keys) != len(values) {
		return fmt.Errorf("number of keys is different to number of values")
	}

	// Check if the key is already used.
	conf, err := shconf.ParseFile(filename)
	if err != nil {
		if err != os.ErrNotExist {
			return err
		}
		println("ErrNotExist") //TODO: remove
	}

	var buf bytes.Buffer
	for i, key := range keys {
		if _, err = conf.Get(key); err != nil {
			continue // TODO: log key already set.
		}

		buf.WriteString(key)
		buf.Write(conf.Separator())
		buf.WriteString(values[i])
		buf.WriteByte('\n')
	}

	return file.Append(filename, buf.Bytes())
}
func _MSet(filename string, keys, values []string) error {
	if len(keys) != len(values) {
		return fmt.Errorf("number of keys is different to number of values")
	}

	// Check if the key is already used.
	conf, err := shconf.ParseFile(filename)
	if err != nil {
		if err != os.ErrNotExist {
			return err
		}
		println("ErrNotExist") //TODO: remove
	}

	var buf bytes.Buffer
	for i, key := range keys {
		if _, err = conf.Get(key); err != nil {
			continue // TODO: log key already set.
		}

		buf.WriteString(key)
		buf.Write(conf.Separator())
		buf.WriteString(values[i])
		buf.WriteByte('\n')
	}

	return file.Append(filename, buf.Bytes())
}
func _MSet ( filename string , keys , values [ ] string ) error { if len ( keys ) != len ( values ) { return fmt . Errorf ( " " ) } // Check if the key is already used. conf , err := shconf . ParseFile ( filename ) if err != nil { if err != os . ErrNotExist { return err } println ( " " ) //TODO: remove } var buf bytes . Buffer for i , key := range keys { if _ , err = conf . Get ( key ) ; err != nil { continue // TODO: log key already set. } buf . WriteString ( key ) buf . Write ( conf . Separator ( ) ) buf . WriteString ( values [ i ] ) buf . WriteByte ( '\n' ) } return file . Append ( filename , buf . Bytes ( ) ) }
// _MSet sets multiple values named by the keys in the given filename.
_MSet sets multiple values named by the keys in the given filename .