mirror of
https://github.com/vbatts/go-mtree.git
synced 2025-10-04 04:31:00 +00:00
visitor pattern
This commit is contained in:
parent
739d74de3c
commit
cc12bd7a0b
4 changed files with 93 additions and 57 deletions
5
entry.go
5
entry.go
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue