Skip to content

Commit

Permalink
Merge pull request #32 from alexwhitman/human-readable-size
Browse files Browse the repository at this point in the history
Show file size in human readable format
  • Loading branch information
piranha committed Aug 4, 2015
2 parents 23726f8 + c9f87bf commit 9b1a1b0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion goreplace.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"bytes"
"fmt"
flags "github.com/jessevdk/go-flags"
byten "github.com/pyk/byten"
"math"
"os"
"path/filepath"
Expand Down Expand Up @@ -172,7 +173,7 @@ func (v *GRVisitor) VisitFile(fn string, fi os.FileInfo) {
}

if fi.Size() >= 1024*1024*10 {
errhandle(fmt.Errorf("Skipping %s, too big: %d\n", fn, fi.Size()),
errhandle(fmt.Errorf("Skipping %s, too big: %s\n", fn, byten.Size(fi.Size())),
false)
return
}
Expand Down

0 comments on commit 9b1a1b0

Please sign in to comment.