func (s *Stack) Get(path string) map[string]interface{} {
	list := SplitPath(path)
	if len(list) <= 0 {
		return map[string]interface{}{}
	}
	m := map[string]interface{}{}
	for i, _ := range append([]string{""}, list...) {
		key := filepath.Join(list[:i]...)
		if m0, ok := s.m[key]; ok {
			m = mergemap.Merge(m, m0)
		}
	}
	return m
}
Get returns the aggregate metadata visible from the given path.
package main
import (
	"path/filepath"
	"github.com/peterbourgon/mergemap"
)
type StackReader interface {
	Get(path string) map[string]interface{}
}
type StackWriter interface {
	Add(path string, m map[string]interface{})
}
type StackReadWriter interface {
	StackReader
	StackWriter
}
type Stack struct {
	m map[string]map[string]interface{}  
}
func NewStack() *Stack {
	return &Stack{
		m: map[string]map[string]interface{}{},
	}
}
func (s *Stack) Add(path string, m map[string]interface{}) {
	key := filepath.Join(SplitPath(path)...)
	existing, ok := s.m[key]
	if !ok {
		existing = map[string]interface{}{}
	}
	s.m[key] = mergemap.Merge(existing, m)
}