func SaveEPUB(book *EPUB, filename string) error {
	var err error

	file, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE, 0666)
	if err != nil {
		return err
	}
	defer file.Close()

	w := zip.NewWriter(file)
	defer w.Close()
	err = WriteMimeType(w)
	if err != nil {
		return err
	}
	err = WriteContainer(book, w)
	if err != nil {
		return err
	}
	err = WriteRootFiles(book, w)
	if err != nil {
		return err
	}
	err = WriteRefFiles(book, w)
	if err != nil {
		return err
	}

	return err
}
//SaveEPUB serialize structures and write it to file
SaveEPUB serialize structures and write it to file
// SaveEPUB serialize structures and write it to file
func SaveEPUB(book *EPUB, filename string) error {
	var err error
	file, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE, 0666)
	if err != nil {
		return err
	}
	defer file.Close()
	w := zip.NewWriter(file)
	defer w.Close()
	err = WriteMimeType(w)
	if err != nil {
		return err
	}
	err = WriteContainer(book, w)
	if err != nil {
		return err
	}
	err = WriteRootFiles(book, w)
	if err != nil {
		return err
	}
	err = WriteRefFiles(book, w)
	if err != nil {
		return err
	}
	return err
}
func SaveEPUB ( book * EPUB , filename string ) error { var err error file , err := os . OpenFile ( filename , os . O_WRONLY | os . O_CREATE , 0666 ) if err != nil { return err } defer file . Close ( ) w := zip . NewWriter ( file ) defer w . Close ( ) err = WriteMimeType ( w ) if err != nil { return err } err = WriteContainer ( book , w ) if err != nil { return err } err = WriteRootFiles ( book , w ) if err != nil { return err } err = WriteRefFiles ( book , w ) if err != nil { return err } return err }
SaveEPUB serialize structures and write it to file
SaveEPUB serialize structures and write it to file