# HG changeset patch # User Mikael Berthe # Date 1539524730 -7200 # Node ID bce80b708ddbff0c9c08b08638ae4ec44b571bfb # Parent 7f9cdb9d166dd3a65f6be171a6f1e2f4443998ea JSON: Add fields 'total_size' and 'total_size_h' diff -r 7f9cdb9d166d -r bce80b708ddb goduf.go --- a/goduf.go Sun Oct 14 15:44:28 2018 +0200 +++ b/goduf.go Sun Oct 14 15:45:30 2018 +0200 @@ -61,12 +61,14 @@ // Results contains the results of the duplicates search type Results struct { - Groups []ResultSet `json:"groups"` - Duplicates uint `json:"duplicates"` - NumberOfSets uint `json:"number_of_sets"` - RedundantDataSize uint64 `json:"redundant_data_size"` - RedundantDataSizeH string `json:"redundant_data_size_h"` - TotalFileCount uint `json:"total_file_count"` + Groups []ResultSet `json:"groups"` // List of duplicate sets + Duplicates uint `json:"duplicates"` // Number of duplicates + NumberOfSets uint `json:"number_of_sets"` // Number of duplicate sets + RedundantDataSize uint64 `json:"redundant_data_size"` // Redundant data size + RedundantDataSizeH string `json:"redundant_data_size_h"` // Same, human-readable + TotalFileCount uint `json:"total_file_count"` // Total number of checked files + TotalSize uint64 `json:"total_size"` // Total size for checked files + TotalSizeH string `json:"total_size_h"` // Same, human-readable } // ResultSet contains a group of identical duplicate files @@ -532,6 +534,8 @@ results.NumberOfSets = uint(len(results.Groups)) results.RedundantDataSizeH = formatSize(results.RedundantDataSize, true) results.TotalFileCount = data.cmpt + results.TotalSize = data.totalSize + results.TotalSizeH = formatSize(data.totalSize, true) return results, nil }