Skip to content

Commit 7f3b935

Browse files
committed
Refactor print statements for compression and decompression output
1 parent 79f50ea commit 7f3b935

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed
4 Bytes
Binary file not shown.

main.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ func handleDecompress(fileName, outputDir, password string) {
4141

4242
decryptedFile.Close()
4343

44-
utils.ColorPrint(utils.GREEN, "Decrypted file: "+decryptedFilePath+"\n")
45-
4644
paths, err := compressor.Decompress(decryptedFilePath, outputDir)
4745
if err != nil {
4846
utils.ColorPrint(utils.RED, err.Error()+"\n")
@@ -55,7 +53,7 @@ func handleDecompress(fileName, outputDir, password string) {
5553
utils.SafeDeleteFile(decryptedFilePath)
5654

5755
for _, path := range paths {
58-
utils.ColorPrint(utils.GREEN, "Decompressed file: "+path+"\n")
56+
utils.ColorPrint(utils.GREEN, "Output file: "+path+"\n")
5957
}
6058
}
6159

@@ -70,8 +68,6 @@ func handleCompress(fileNames []string, outputDir, password, algorithm string) {
7068
fileMeta.PrintFileInfo()
7169
fileMeta.PrintCompressionRatio()
7270

73-
utils.ColorPrint(utils.GREEN, "Compressed file: "+outputPath+"\n")
74-
7571
compressedFile, err := os.Open(outputPath)
7672
if err != nil {
7773
utils.ColorPrint(utils.RED, fmt.Sprintf(constants.FILE_OPEN_ERROR, err.Error())+"\n")
@@ -104,7 +100,7 @@ func handleCompress(fileNames []string, outputDir, password, algorithm string) {
104100
os.Exit(-1)
105101
}
106102

107-
utils.ColorPrint(utils.GREEN, "Encrypted file: "+finalFileName+"\n")
103+
utils.ColorPrint(utils.GREEN, "Output file: "+finalFileName+"\n")
108104

109105
compressedFile.Close()
110106
// delete the compressed file

0 commit comments

Comments
 (0)