func (c *Cache) get0(name string) (parts rr.Parts, hit, expired bool) { var item rr.Bytes if item, hit = c.tree.Get(name).(rr.Bytes); hit { parts = item.Unpack().Partition(false) expired = tidy(time.Now().Unix()-secs0, parts) hit = len(parts) != 0 } return }
func TestEnum0(t *testing.T) { c := New() var hit bool var x rr.Bytes c.Enum(".", func(path []string, found rr.Bytes) bool { x = found hit = true return false }) if hit { t.Fatal(x.Unpack()) } }