func (l Volume) CacheDirHost() string {
	return l.cacheDirHost
}
CacheDirHost returns the fyne-cross cache dir on the host
package volume
import (
	"archive/zip"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"path"
	"path/filepath"
	"strings"
	"github.com/fyne-io/fyne-cross/internal/icon"
)
const (
	fyneCrossPrefix = "fyne-cross"
	binRelativePath  = "fyne-cross/bin"
	distRelativePath = "fyne-cross/dist"
	tmpRelativePath  = "fyne-cross/tmp"
	binDirContainer     = "/app/" + binRelativePath
	cacheDirContainer   = "/go"
	goCacheDirContainer = "/go/go-build"
	distDirContainer    = "/app/" + distRelativePath
	tmpDirContainer     = "/app/" + tmpRelativePath
	workDirContainer    = "/app"
)
func Copy(src string, dst string) error {
	data, err := ioutil.ReadFile(src)
	if err != nil {
		return err
	}
	return ioutil.WriteFile(dst, data, 0644)
}
func DefaultCacheDirHost() (string, error) {
	userCacheDir, err := os.UserCacheDir()
	if err != nil {
		return "", fmt.Errorf("cannot get the path for the system cache directory on the host %s", err)
	}
	return JoinPathHost(userCacheDir, fyneCrossPrefix), nil
}
func DefaultIconHost() (string, error) {
	wd, err := DefaultWorkDirHost()
	if err != nil {
		return "", err
	}
	return JoinPathHost(wd, icon.Default), nil
}
func DefaultWorkDirHost() (string, error) {
	wd, err := os.Getwd()
	if err != nil {
		return "", fmt.Errorf("cannot get the path for the work directory on the host %s", err)
	}
	return wd, nil
}
func Mount(workDirHost string, cacheDirHost string) (Volume, error) {
	var err error
	if workDirHost == "" {
		workDirHost, err = DefaultWorkDirHost()
		if err != nil {
			return Volume{}, err
		}
	}
	if cacheDirHost == "" {
		cacheDirHost, err = DefaultCacheDirHost()
		if err != nil {
			return Volume{}, err
		}
	}
	l := Volume{
		binDirHost:   JoinPathHost(workDirHost, binRelativePath),
		cacheDirHost: cacheDirHost,
		distDirHost:  JoinPathHost(workDirHost, distRelativePath),
		tmpDirHost:   JoinPathHost(workDirHost, tmpRelativePath),
		workDirHost:  workDirHost,
	}
	err = createHostDirs(l)
	if err != nil {
		return l, err
	}
	return l, nil
}
func JoinPathContainer(elem ...string) string {
	return path.Clean(strings.Join(elem, "/"))
}
func JoinPathHost(elem ...string) string {
	return filepath.Clean(filepath.Join(elem...))
}
func Zip(source string, archive string) error {
	sourceData, err := os.Open(source)
	if err != nil {
		return fmt.Errorf("could not read the source file content: %s", err)
	}
	defer sourceData.Close()
	sourceInfo, err := sourceData.Stat()
	if err != nil {
		return fmt.Errorf("could not get the source file info: %s", err)
	}
	archiveFile, err := os.Create(archive)
	if err != nil {
		return fmt.Errorf("could not create the zip archive file: %s", err)
	}
	zipWriter := zip.NewWriter(archiveFile)
	header, err := zip.FileInfoHeader(sourceInfo)
	if err != nil {
		return fmt.Errorf("could not create the file header: %s", err)
	}
	header.Method = zip.Deflate
	w, err := zipWriter.CreateHeader(header)
	if err != nil {
		return fmt.Errorf("could not add the source file to the zip archive: %s", err)
	}
	_, err = io.Copy(w, sourceData)
	if err != nil {
		return fmt.Errorf("could not write the source file content into the zip archive: %s", err)
	}
	err = zipWriter.Close()
	if err != nil {
		return fmt.Errorf("could not close the zip archive: %s", err)
	}
	return archiveFile.Close()
}
type Volume struct {
	binDirHost   string
	cacheDirHost string
	distDirHost  string
	tmpDirHost   string
	workDirHost  string
}
func (l Volume) BinDirContainer() string {
	return binDirContainer
}
func (l Volume) BinDirHost() string {
	return l.binDirHost
}
func (l Volume) CacheDirContainer() string {
	return cacheDirContainer
}