Skip to content

Commit

Permalink
Fix tests to work on Go 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissawer committed Mar 1, 2024
1 parent 8972d51 commit 47a43a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extractor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ func TestUnixPermissions(t *testing.T) {
filename := filepath.Base(path)
// Desired permissions indicated by part of the filenames inside the zip/tar files
if strings.HasPrefix(filename, "dir") {
desiredPermString, _ := strings.CutPrefix(filename, "dir")
desiredPermString := strings.Split(filename, "dir")[1]
desiredPerms, _ := strconv.ParseUint(desiredPermString, 8, 32)
require.Equal(t, os.ModeDir|os.FileMode(OsDirPerms(desiredPerms)), info.Mode())
} else if strings.HasPrefix(filename, "file") {
desiredPermString, _ := strings.CutPrefix(filename, "file")
desiredPermString := strings.Split(filename, "file")[1]
desiredPerms, _ := strconv.ParseUint(desiredPermString, 8, 32)
require.Equal(t, os.FileMode(OsFilePerms(desiredPerms)), info.Mode())
}
Expand Down

0 comments on commit 47a43a0

Please sign in to comment.