func Open(filePath string) (*PackageFile, error) {
	file, err := os.Open(filePath)
	if err != nil {
		return nil, err
	}
	fStats, err := file.Stat()
	if err != nil {
		return nil, err
	}
	return &PackageFile{
		file,
		NewReader(file, fStats.Size()),
	}, nil
}
Open will open the package (zip or jar) file specified by name and return a PackageFile.
package pack
import (
	"archive/zip"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"github.com/minepkg/minepkg/pkg/manifest"
	"github.com/pelletier/go-toml"
)
type Reader struct {
	zipReader *zip.Reader
}
func (p *Reader) Manifest() *manifest.Manifest {
	var manFile *zip.File
	for _, file := range p.Files() {
		if file.Name == "minepkg.toml" {
			manFile = file
			break
		}
	}
	manReader, err := manFile.Open()
	if err != nil {
		panic(err)
	}
	defer manReader.Close()
	manBuf, err := ioutil.ReadAll(manReader)
	if err != nil {
		panic(err)
	}
	var parsedManifest manifest.Manifest
	toml.Unmarshal(manBuf, &parsedManifest)
	return &parsedManifest
}
func (p *Reader) Files() []*zip.File {
	return p.zipReader.File
}
func (p *Reader) ExtractModpack(dest string) error {
	zipReader := p.zipReader
	skipPrefixes := []string{}
	createdDirs := make(map[string]interface{})
outer:
	for _, f := range zipReader.File {
		if err := sanitizeExtractPath(f.Name, dest); err != nil {
			return err
		}
		relative, err := filepath.Rel(dest, filepath.Join(dest, f.Name))
		if err != nil {
			return err
		}
		for _, skip := range skipPrefixes {
			if strings.HasPrefix(relative, skip) {
				continue outer
			}
		}
		if f.FileInfo().IsDir() {
			continue outer
		}
		relativeDir := filepath.Dir(relative)
		dirs := strings.Split(relativeDir, string(filepath.Separator))
		for n := range dirs {
			dir := strings.Join(dirs[0:n+1], string(filepath.Separator))
			if _, ok := createdDirs[dir]; ok {
				continue
			}
			err := os.Mkdir(filepath.Join(dest, dir), os.ModePerm)
			createdDirs[dir] = nil
			switch {
			case err != nil && !os.IsExist(err):
				return err
			case err != nil && strings.HasPrefix(dir, "saves") && dir != "saves":
				skipPrefixes = append(skipPrefixes, dir)
				continue outer
			}
		}
		rc, err := f.Open()
		if err != nil {
			return err
		}
		defer rc.Close()
		target, err := os.Create(filepath.Join(dest, f.Name))
		if err != nil {
			return err
		}
		defer target.Close()
		_, err = io.Copy(target, rc)
		if err != nil {
			return err
		}
	}
	return nil
}
func NewReader(reader io.ReaderAt, size int64) *Reader {
	zipReader, err := zip.NewReader(reader, size)
	if err != nil {
		panic(err)
	}
	return &Reader{zipReader}
}
type PackageFile struct {
	*os.File
	*Reader
}