Skip to content

Commit 8a548c9

Browse files
committed
Refactoring to remove GetCompressionRatio func from dataconverter
1 parent 7015866 commit 8a548c9

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

cmd/samples/recipes/dataconverter/dataconverter.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,3 @@ func (dc *compressedJSONDataConverter) FromData(input []byte, valuePtr ...interf
6969
}
7070
return nil
7171
}
72-
73-
// GetCompressionRatio returns the compression ratio for demonstration purposes
74-
func (dc *compressedJSONDataConverter) GetCompressionRatio(originalData []byte) (float64, error) {
75-
// Simulate the compression process to calculate ratio
76-
compressedData, err := dc.ToData(string(originalData))
77-
if err != nil {
78-
return 0, err
79-
}
80-
81-
ratio := float64(len(compressedData)) / float64(len(originalData))
82-
return ratio, nil
83-
}

0 commit comments

Comments
 (0)