Fix walk function in test to not panic if an error is passed

This commit is contained in:
Martin Bertschler 2015-12-06 16:25:06 +01:00
parent 17333d8c34
commit 708d4bcfd5
1 changed files with 4 additions and 0 deletions

View File

@ -462,6 +462,10 @@ func TestWalk(t *testing.T) {
outputs := make([]string, len(Fss))
for i, fs := range Fss {
walkFn := func(path string, info os.FileInfo, err error) error {
if err != nil {
t.Error("walkFn error:", err)
return nil
}
var size int64
if !info.IsDir() {
size = info.Size()