func LoadBytes(buf []byte) (*File, error) {
	return Parse("<buffer>", "", bytes.NewReader(buf))
}
LoadBytes loads ini file from a byte slice.
package ini
import (
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"strings"
	"github.com/knq/ini/parser"
)
type Error string
func (err Error) Error() string {
	return string(err)
}
const (
	ErrNoFilenameSupplied Error = "no filename supplied"
)
type ParseError struct {
	name string
	err  error
}
func (err *ParseError) Error() string {
	return fmt.Sprintf("unable to parse %s: %v", err.name, err.err)
}
type File struct {
	*parser.File         
	Filename     string  
}
func NewFile() *File {
	return &File{
		File:     parser.NewFile(nil),
		Filename: "",
	}
}
func (f *File) Save() error {
	if f.Filename == "" {
		return ErrNoFilenameSupplied
	}
	return f.Write(f.Filename)
}
func Parse(name, filename string, r io.Reader) (*File, error) {
	buf, err := fixEnding(r)
	if err != nil {
		return nil, err
	}
	f, err := parser.Parse(name, buf)
	if err != nil {
		return nil, &ParseError{name, parser.LastError()}
	}
	inifile, ok := f.(*parser.File)
	if !ok {
		return nil, &ParseError{name, parser.LastError()}
	}
	return &File{
		File:     inifile,
		Filename: filename,
	}, nil
}
func Load(r io.Reader) (*File, error) {
	return Parse("<io.Reader>", "", r)
}