rename diff function

This commit is contained in:
William Banfield
2022-05-11 09:57:26 -04:00
parent 7947e9ea5f
commit e0badc0b2f
2 changed files with 4 additions and 4 deletions
@@ -59,16 +59,16 @@ func main() {
if err != nil {
log.Fatalf("Unable to open file %s: %v", os.Args[2], err)
}
md, err := MetricsDiffFromReaders(fa, fb)
md, err := DiffFromReaders(fa, fb)
if err != nil {
log.Fatalf("Generating diff: %v", err)
}
fmt.Printf("%s", md)
}
// MetricsDiffFromReaders parses the metrics present in the readers a and b and
// DiffFromReaders parses the metrics present in the readers a and b and
// determines which metrics were added and removed in b.
func MetricsDiffFromReaders(a, b io.Reader) (Diff, error) {
func DiffFromReaders(a, b io.Reader) (Diff, error) {
parser := expfmt.TextParser{}
amf, err := parser.TextToMetricFamilies(a)
if err != nil {
@@ -56,7 +56,7 @@ func TestDiff(t *testing.T) {
require.NoError(t, err)
_, err = io.WriteString(bufB, tc.bContents)
require.NoError(t, err)
md, err := metricsdiff.MetricsDiffFromReaders(bufA, bufB)
md, err := metricsdiff.DiffFromReaders(bufA, bufB)
require.NoError(t, err)
require.Equal(t, tc.want, md)
})