func (g *GoRef) GetChild(path ...string) *GoRef {
	if len(path) == 0 {
		return g
	}
	firstSegment := path[0]
	var child *GoRef
	{  
		g.childLock.Lock()
		defer g.childLock.Unlock()
		var ok bool
		child, ok = g._children[firstSegment]
		if !ok {
			child = newGoRef(firstSegment, g)
			g._children[firstSegment] = child
		}
	}
	return child.GetChild(path[1:]...)
}
GetChild -- Gets (or creates) a specific child instance (recursively)
package goref
import (
	"sync"
	"time"
)
type data struct {
	active int32
	count int64
	nsec int64
}
const (
	evStop = iota
	evReset = iota
	evSnapshot = iota
	evRef = iota
	evDeref = iota
)
type event struct {
	typ  int
	key  string
	nsec int64
}
type GoRef struct {
	name   string
	parent *GoRef
	data map[string]*data
	_children map[string]*GoRef
	childLock sync.Mutex
	evChannel       chan event
	snapshotChannel chan Snapshot
}
func (g *GoRef) do(evType int, key string, nsec int64) {
	g.evChannel <- event{
		typ:  evType,
		key:  key,
		nsec: nsec,
	}
}
func (g *GoRef) get(key string) *data {
	rc, ok := g.data[key]
	if !ok {
		rc = &data{}
		g.data[key] = rc
	}
	return rc
}
func (g *GoRef) Ref(key string) *Instance {
	g.do(evRef, key, 0)
	return &Instance{
		parent:    g,
		key:       key,
		startTime: time.Now(),
	}
}
func (g *GoRef) run() {
	for msg := range g.evChannel {
		switch msg.typ {
		case evRef:
			g.get(msg.key).active++
			break
		case evDeref:
			d := g.get(msg.key)
			d.active--
			d.count++
			d.nsec += msg.nsec
			break
		case evSnapshot:
			g.takeSnapshot()
			break
		case evReset:
			g.data = map[string]*data{}
			break
		case evStop:
			return  
		default:
			panic("unsupported GoRef event type")
		}
	}
}