Skip to content

Commit

Permalink
resolved
Browse files Browse the repository at this point in the history
Signed-off-by: SudhanshuBawane <[email protected]>
  • Loading branch information
SudhanshuBawane committed Mar 19, 2024
1 parent 357ac9f commit d2a0d01
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
5 changes: 0 additions & 5 deletions asset/expander.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,3 @@ func sniffType(f io.ReadSeeker) (filetype_types.Type, error) {

return ft, nil
}

// cleanup of the assetSHA when cache dir gets force deleted
//func CleanUp(fullPath string) error {
// return os.RemoveAll(fullPath)
//}
30 changes: 0 additions & 30 deletions asset/expander_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,33 +113,3 @@ func TestExpandInvalidArchive(t *testing.T) {
t.Fail()
}
}

// ---Test to check CleanUp
//func TestCleanUp(t *testing.T) {
// t.Parallel()
//
// // Create a temporary directory for testing
// tmpDir := t.TempDir()
//
// // Define the SHA and file name
// SHAName := "shaAsset.tar"
// SHAFilePath := filepath.Join(tmpDir, SHAName)
//
// // Create a dummy file inside the temporary directory
// SHAFile, err := os.Create(SHAFilePath)
// if err != nil {
// t.Fatalf("Failed to create dummy file: %v", err)
// }
// SHAFile.Close()
//
// // Call CleanUp with the SHA of the dummy file and the temporary directory
// err = CleanUp(SHAFilePath)
// if err != nil {
// t.Errorf("CleanUp returned an error: %v", err)
// }
//
// _, err = os.Stat(SHAFilePath)
// if !os.IsNotExist(err) {
// t.Errorf("CleanUp did not remove the dummy file as expected")
// }
//}

0 comments on commit d2a0d01

Please sign in to comment.