test tree foreach
This commit is contained in:
@@ -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 ""
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user