Skip to content

Commit

Permalink
*.go: clean up variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
vbatts committed Aug 19, 2018
1 parent 2f374a3 commit 03270d3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
14 changes: 8 additions & 6 deletions compare.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,16 +350,17 @@ func Compare(oldDh, newDh *DirectoryHierarchy, keys []Keyword) ([]InodeDelta, er
if err != nil {
return nil, err
}
//fmt.Printf("new: %q\n", path)

// Cannot take &kv because it's the iterator.
copy := new(Entry)
*copy = e
cEntry := new(Entry)
*cEntry = e

_, ok := diffs[path]
if !ok {
diffs[path] = &stateT{}
}
diffs[path].Old = copy
diffs[path].Old = cEntry
}
}
}
Expand All @@ -372,16 +373,17 @@ func Compare(oldDh, newDh *DirectoryHierarchy, keys []Keyword) ([]InodeDelta, er
if err != nil {
return nil, err
}
//fmt.Printf("old: %q\n", path)

// Cannot take &kv because it's the iterator.
copy := new(Entry)
*copy = e
cEntry := new(Entry)
*cEntry = e

_, ok := diffs[path]
if !ok {
diffs[path] = &stateT{}
}
diffs[path].New = copy
diffs[path].New = cEntry
}
}
}
Expand Down
19 changes: 11 additions & 8 deletions mtree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"io/ioutil"
"os"
"testing"

"github.com/davecgh/go-spew/spew"
)

var (
Expand Down Expand Up @@ -54,14 +56,15 @@ func TestParser(t *testing.T) {
if err != nil {
t.Error(err)
}
/*
if i == 1 {
buf, err := xml.MarshalIndent(dh, "", " ")
if err == nil {
t.Error(string(buf))
}
}
*/

if i == 1 {
spew.Dump(dh)
//buf, err := xml.MarshalIndent(dh, "", " ")
//if err == nil {
//t.Error(string(buf))
//}
}

gotNums := countTypes(dh)
for typ, num := range tf.Counts {
if gNum, ok := gotNums[typ]; ok {
Expand Down

0 comments on commit 03270d3

Please sign in to comment.