diff options
author | Will Murphy <willmurphyscode@gmail.com> | 2018-06-24 15:04:29 -0400 |
---|---|---|
committer | Will Murphy <willmurphyscode@gmail.com> | 2018-06-24 15:04:29 -0400 |
commit | 789643261f44d6ddf6bc9020ec8558d2f5110412 (patch) | |
tree | 844eb67a530f9ad77549b03df8efa351d69b7aaa /filetree/node.go | |
parent | ef2c76930f1d22ad7be4aff17ef1f90db2d34a4b (diff) |
mostly working
Diffstat (limited to 'filetree/node.go')
-rw-r--r-- | filetree/node.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/filetree/node.go b/filetree/node.go index 979ecf1..05596b4 100644 --- a/filetree/node.go +++ b/filetree/node.go @@ -1,14 +1,14 @@ package filetree import ( + "archive/tar" + "fmt" "sort" "strings" + "github.com/dustin/go-humanize" "github.com/fatih/color" - "fmt" "github.com/phayes/permbits" - "github.com/dustin/go-humanize" - "github.com/wagoodman/docker-image-explorer/_vendor-20180604210951/github.com/Microsoft/go-winio/archive/tar" ) const ( @@ -16,11 +16,11 @@ const ( ) type FileNode struct { - Tree *FileTree - Parent *FileNode - Name string - Data NodeData - Children map[string]*FileNode + Tree *FileTree + Parent *FileNode + Name string + Data NodeData + Children map[string]*FileNode } func NewNode(parent *FileNode, name string, data FileInfo) (node *FileNode) { @@ -125,7 +125,7 @@ func (node *FileNode) MetadataString() string { userGroup := fmt.Sprintf("%d:%d", user, group) size := humanize.Bytes(uint64(node.Data.FileInfo.TarHeader.FileInfo().Size())) - return style.Sprint(fmt.Sprintf(AttributeFormat,dir, fileMode, userGroup, size)) + return style.Sprint(fmt.Sprintf(AttributeFormat, dir, fileMode, userGroup, size)) } func (node *FileNode) VisitDepthChildFirst(visiter Visiter, evaluator VisitEvaluator) error { @@ -161,7 +161,7 @@ func (node *FileNode) VisitDepthParentFirst(visiter Visiter, evaluator VisitEval } // never visit the root node - if node != node.Tree.Root{ + if node != node.Tree.Root { err = visiter(node) if err != nil { return err @@ -225,7 +225,7 @@ func (node *FileNode) deriveDiffType(diffType DiffType) error { } - return node.AssignDiffType(myDiffType) + return node.AssignDiffType(myDiffType) } func (node *FileNode) AssignDiffType(diffType DiffType) error { |