func (c *Collection) Load() error {
	c.groups = make([]*Group, 0)
	file, err := ioutil.ReadFile(c.path)
	if err != nil {
		return fmt.Errorf("Error opening assets file %s %v", c.path, err)
	}
	var data map[string]map[string]interface{}
	err = json.Unmarshal(file, &data)
	if err != nil {
		return fmt.Errorf("Error reading assets %s %v", c.path, err)
	}
	for d, dv := range data {
		g := c.FetchOrCreateGroup(d)
		for k, v := range dv {
			switch k {
			case "scripts":
				g.scripthash = v.(string)
			case "styles":
				g.stylehash = v.(string)
			case "files":
				for p, h := range v.(map[string]interface{}) {
					g.AddAsset(p, h.(string))
				}
			}
		}
	}
	for _, g := range c.groups {
		sort.Sort(g.files)
	}
	return nil
}
Load the asset groups from the assets json file
Call this on startup from your app to read the asset details after assets are compiled
package assets
import (
	"bytes"
	"crypto/sha1"
	"encoding/hex"
	"encoding/json"
	"fmt"
	"io/ioutil"
	"path"
	"path/filepath"
	"sort"
)
type Collection struct {
	serveCompiled bool
	path          string
	groups        []*Group
}
func New(compiled bool) *Collection {
	c := &Collection{
		serveCompiled: compiled,
		path:          "secrets/assets.json",
	}
	return c
}
func (c *Collection) File(name string) *File {
	for _, g := range c.groups {
		for _, f := range g.files {
			if f.name == name {
				return f
			}
		}
	}
	return nil
}
func (c *Collection) Group(name string) *Group {
	for _, g := range c.groups {
		if g.name == name {
			return g
		}
	}
	return &Group{name: name}  
}
func (c *Collection) FetchOrCreateGroup(name string) *Group {
	for _, g := range c.groups {
		if g.name == name {
			return g
		}
	}
	g := &Group{name: name}
	c.groups = append(c.groups, g)
	return g
}
func (c *Collection) MarshalJSON() ([]byte, error) {
	var b bytes.Buffer
	b.WriteString("{")
	for i, g := range c.groups {
		gb, err := g.MarshalJSON()
		if err != nil {
			return nil, err
		}
		b.Write(gb)
		if i+1 < len(c.groups) {
			b.WriteString(",")
		}
	}
	b.WriteString("}")
	return b.Bytes(), nil
}
func (c *Collection) Save() error {
	data, err := json.MarshalIndent(c, "", "\t")
	if err != nil {
		return fmt.Errorf("Error marshalling assets file %s %v", c.path, err)
	}
	err = ioutil.WriteFile(c.path, data, 0644)
	if err != nil {
		return fmt.Errorf("Error writing assets file %s %v", c.path, err)
	}
	return nil
}