operations: turn ListFormatted into a Format method on ListFormat

This commit is contained in:
Nick Craig-Wood 2018-05-13 10:55:18 +01:00
parent db4c206e0e
commit 2a32e2d838
3 changed files with 18 additions and 18 deletions

View file

@ -1445,11 +1445,11 @@ func (l *ListFormat) AppendOutput(functionToAppend func() string) {
l.output = append(l.output, functionToAppend)
}
// ListFormatted prints information about specific file in specific format
func ListFormatted(entry *fs.DirEntry, list *ListFormat) string {
list.entry = *entry
// Format prints information about the DirEntry in the format defined
func (l *ListFormat) Format(entry fs.DirEntry) string {
l.entry = entry
var out string
for _, fun := range list.output {
for _, fun := range l.output {
out += fun()
}
return out