Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit23356f6

Browse files
committed
fix: make normalizeGolden private
1 parentde194a7 commit23356f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎cli/clitest/golden.go

Lines changed: 4 additions & 4 deletions
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-
funcNormalizeGoldenFile(t*testing.T,byt []byte) []byte {
128+
funcnormalizeGoldenFile(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)

[8]ページ先頭

©2009-2025 Movatter.jp