test tree foreach

This commit is contained in:
Bel LaPointe
2022-02-16 08:05:14 -07:00
parent 63caf9ed03
commit a7c8a0d481
5 changed files with 39 additions and 16 deletions

View File

@@ -14,11 +14,11 @@ func NewID(s string) ID {
}
func (id ID) Push(child string) ID {
return ID(path.Join(id.String(), child)).withClean()
return NewID(path.Join(id.String(), child)).withClean()
}
func (id ID) Pop() ID {
pid := path.Clean(ID(path.Dir(id.String())).withClean().String())
pid := path.Clean(NewID(path.Dir(id.String())).withClean().String())
if strings.HasPrefix(pid, ".") {
return ""
}