1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2025-07-27 00:30:27 +00:00

visitor pattern

This commit is contained in:
thesayyn 2023-10-24 15:58:31 -07:00
parent c8c5616b53
commit 17374843eb
No known key found for this signature in database
GPG key ID: D10C0AE203D0E4A8
4 changed files with 93 additions and 57 deletions

View file

@ -134,7 +134,10 @@ func (e Entry) String() string {
if e.Type == SpecialType || e.Type == FullType || inKeyValSlice("type=dir", e.Keywords) {
return fmt.Sprintf("%s %s", e.Name, strings.Join(KeyValToString(e.Keywords), " "))
}
return fmt.Sprintf(" %s %s", e.Name, strings.Join(KeyValToString(e.Keywords), " "))
if e.Parent != nil && e.Type != DotDotType {
return fmt.Sprintf(" %s %s", e.Name, strings.Join(KeyValToString(e.Keywords), " "))
}
return fmt.Sprintf("%s %s", e.Name, strings.Join(KeyValToString(e.Keywords), " "))
}
// AllKeys returns the full set of KeyVal for the given entry, based on the