Skip to content

Commit

Permalink
fix: compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
testwill committed Jul 15, 2023
1 parent dcf7be1 commit 41888ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 6 additions & 4 deletions internal/databases/postgres/walk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,11 @@ func compare(t *testing.T, dir1, dir2 string) bool {
var deepEqual bool
for i, f2 := range files2 {
f1 := files1[i]
info1, _ := f1.Info()
info2, _ := f2.Info()
name := f1.Name() == f2.Name()
size := f1.Size() == f2.Size()
mode := f1.Mode() == f2.Mode()
size := info1.Size() == info2.Size()
mode := info1.Mode() == info2.Mode()
isDir := f1.IsDir() == f2.IsDir()

// If directory is in ExcludedFilenames list, make sure it exists but is empty.
Expand Down Expand Up @@ -242,8 +244,8 @@ func compare(t *testing.T, dir1, dir2 string) bool {

}
} else {
t.Logf("walk: Original: \t%s\t %d\t %d\t %v", f1.Name(), f1.Size(), f1.Mode(), f1.IsDir())
t.Logf("walk: Extracted: \t%s\t %d\t %d\t %v", f2.Name(), f2.Size(), f2.Mode(), f2.IsDir())
t.Logf("walk: Original: \t%s\t %d\t %d\t %v", f1.Name(), info1.Size(), info1.Mode(), f1.IsDir())
t.Logf("walk: Extracted: \t%s\t %d\t %d\t %v", f2.Name(), info2.Size(), info2.Mode(), f2.IsDir())
}

}
Expand Down
5 changes: 3 additions & 2 deletions tests_func/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ func CopyDirectory(src, dest string, filter string) error {
return err
}

isSymlink := entry.Mode()&os.ModeSymlink != 0
info, _ := entry.Info()
isSymlink := info.Mode()&os.ModeSymlink != 0
if !isSymlink {
if err := os.Chmod(destPath, entry.Mode()); err != nil {
if err := os.Chmod(destPath, info.Mode()); err != nil {
return err
}
}
Expand Down

0 comments on commit 41888ee

Please sign in to comment.