Skip to content

Commit

Permalink
Change output format for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
aswinkarthik committed Apr 16, 2018
1 parent 391192d commit 729b67d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ Csvdiff is a difftool to compute changes between two csv files. It is not a trad

```bash
$ csvdiff run --base base.csv --delta delta.csv
2018/04/15 18:46:23 Generated Digest for delta
2018/04/15 18:46:24 Generated Digest for base
2018/04/15 18:46:24 Additions Count: 1
# Additions: 1
...

2018/04/15 18:46:24 Modifications Count: 20
# Modifications: 20
...
```

Expand Down
10 changes: 5 additions & 5 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ func generateInBackground(name string, config *digest.Config, wg *sync.WaitGroup
panic(err)
}

log.Println("Generated Digest for " + name)
if debug {
log.Println("Generated Digest for " + name)
}
channel <- message{digestMap: digest, sourceMap: sourceMap}
close(channel)
wg.Done()
Expand All @@ -118,16 +120,14 @@ func compareInBackgroud(baseChannel, deltaChannel <-chan message, wg *sync.WaitG
defer aWriter.Close()
defer mWriter.Close()

fmt.Println()
print("Additions", aWriter, additions, deltaMessage.sourceMap)
fmt.Println()
print("Modifications", mWriter, modifications, deltaMessage.sourceMap)
fmt.Println()
wg.Done()
}

func print(recordType string, w io.Writer, positions []uint64, content map[uint64]string) {
log.Println(fmt.Sprintf("%s Count: %d", recordType, len(positions)))
fmt.Println(fmt.Sprintf("# %s: %d", recordType, len(positions)))
fmt.Println()

for _, i := range positions {
w.Write([]byte(content[i]))
Expand Down

0 comments on commit 729b67d

Please sign in to comment.