Skip to content

Commit 23356f6

Browse files
committed
fix: make normalizeGolden private
1 parent de194a7 commit 23356f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cli/clitest/golden.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ func TestGoldenFile(t *testing.T, fileName string, actual []byte, replacements m
103103
actual = bytes.ReplaceAll(actual, []byte(k), []byte(v))
104104
}
105105

106-
actual = NormalizeGoldenFile(t, actual)
106+
actual = normalizeGoldenFile(t, actual)
107107
goldenPath := filepath.Join("testdata", strings.ReplaceAll(fileName, " ", "_")+".golden")
108108
if *UpdateGoldenFiles {
109109
t.Logf("update golden file for: %q: %s", fileName, goldenPath)
@@ -114,18 +114,18 @@ func TestGoldenFile(t *testing.T, fileName string, actual []byte, replacements m
114114
expected, err := os.ReadFile(goldenPath)
115115
require.NoError(t, err, "read golden file, run \"make update-golden-files\" and commit the changes")
116116

117-
expected = NormalizeGoldenFile(t, expected)
117+
expected = normalizeGoldenFile(t, expected)
118118
require.Equal(
119119
t, string(expected), string(actual),
120120
"golden file mismatch: %s, run \"make update-golden-files\", verify and commit the changes",
121121
goldenPath,
122122
)
123123
}
124124

125-
// NormalizeGoldenFile replaces any strings that are system or timing dependent
125+
// normalizeGoldenFile replaces any strings that are system or timing dependent
126126
// with a placeholder so that the golden files can be compared with a simple
127127
// equality check.
128-
func NormalizeGoldenFile(t *testing.T, byt []byte) []byte {
128+
func normalizeGoldenFile(t *testing.T, byt []byte) []byte {
129129
// Replace any timestamps with a placeholder.
130130
byt = timestampRegex.ReplaceAll(byt, []byte("[timestamp]"))
131131

0 commit comments

Comments
 (0)