func (g *Group) Compile(dst string) error {
	var scriptHashes, styleHashes string
	var scriptWriter, styleWriter bytes.Buffer
	for _, f := range g.files {
		if f.Script() {
			scriptHashes += f.hash
			scriptWriter.Write(f.bytes)
			scriptWriter.WriteString("\n\n")
		} else if f.Style() {
			styleHashes += f.hash
			styleWriter.Write(f.bytes)
			styleWriter.WriteString("\n\n")
		}
	}
	g.scripthash = bytesHash([]byte(scriptHashes))
	g.stylehash = bytesHash([]byte(styleHashes))
	err := g.writeFiles(dst, scriptWriter, styleWriter)
	for _, f := range g.files {
		f.bytes = nil
	}
	return err
}
Compile compiles all our files and calculates hashes from their contents
The group hash is a hash of hashes
package assets
import (
	"bytes"
	"fmt"
	"github.com/fragmenta/assets/internal/cssmin"
	"github.com/fragmenta/assets/internal/jsmin"
	"io/ioutil"
	"os"
	"path"
	"path/filepath"
)
type fileArray []*File
func (a fileArray) Len() int           { return len(a) }
func (a fileArray) Less(b, c int) bool { return a[b].name < a[c].name }
func (a fileArray) Swap(b, c int)      { a[b], a[c] = a[c], a[b] }
type Group struct {
	name       string
	files      fileArray
	stylehash  string  
	scripthash string  
}
func (g *Group) Styles() []*File {
	var styles []*File
	for _, f := range g.files {
		if f.Style() {
			styles = append(styles, f)
		}
	}
	return styles
}
func (g *Group) Scripts() []*File {
	var scripts []*File
	for _, f := range g.files {
		if f.Script() {
			scripts = append(scripts, f)
		}
	}
	return scripts
}
func (g *Group) RemoveFiles(dst string) error {
	if dst == "" {
		return fmt.Errorf("Empty destination string")
	}
	var assets []string
	pattern := path.Join(dst, "assets", "scripts", g.name+"-*.min.js")
	files, err := filepath.Glob(pattern)
	if err != nil {
		return err
	}
	assets = append(assets, files...)
	pattern = path.Join(dst, "assets", "styles", g.name+"-*.min.css")
	files, err = filepath.Glob(pattern)
	if err != nil {
		return err
	}
	assets = append(assets, files...)
	for _, a := range assets {
		err = os.Remove(a)
		if err != nil {
			return err
		}
	}
	return nil
}