func (e Embed) Build(files []string) ([]byte, error) {
	var (
		err    error
		data   []byte
		embeds []*Item
	)
	for i := range files {
		if utils.IsDir(files[i]) {
			continue
		}
		if data, err = ioutil.ReadFile(files[i]); err != nil {
			return nil, err
		}
		var gzdata bytes.Buffer
		w := gzip.NewWriter(&gzdata)
		w.Write(data)
		w.Close()
		id := strings.Replace(files[i], e.Root, "", 1)
		if runtime.GOOS == "windows" {
			id = strings.Replace(id, `\`, "/", -1)
		}
		embeds = append(embeds, &Item{
			ID:   id,
			Path: files[i],
			Data: gzdata.Bytes(),
		})
	}
	return e.parse(embeds)
}
Build embed file.
package embed
import (
	"bytes"
	"compress/gzip"
	"fmt"
	"io/ioutil"
	"runtime"
	"strings"
	"text/template"
	"github.com/guark/guark/utils"
)
type (
	Item struct {
		ID   string
		Path string
		Data []byte
	}
	Embed struct {
		Root     string
		Template string
		Funcs    map[string]func(file string, data []byte) string
	}
)