Skip to content

Commit 20355eb

Browse files
maxtaran2010maxtaran2010
andauthored
fix: correct typos in comments and test error messages (#2049)
- histogram.go: interefere -> interfere (in comment) - internal/difflib.go: synching -> syncing (in comment) - collectors/go_collector_latest_test.go: missmatch -> mismatch (4x) - collectors/version/version_test.go: missmatch -> mismatch (4x) Found with codespell. Signed-off-by: maxtaran2010 <ocotifuzo727@gmail.com> Co-authored-by: maxtaran2010 <ocotifuzo727@gmail.com>
1 parent 4cd2d3a commit 20355eb

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

prometheus/collectors/go_collector_latest_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func TestWithGoCollectorDefault(t *testing.T) {
112112
expected := append(withBaseMetrics(memstatMetrics), defaultRuntimeMetrics...)
113113
sort.Strings(expected)
114114
if diff := cmp.Diff(got, expected); diff != "" {
115-
t.Errorf("[IMPORTANT, those are default metrics, can't change in 1.x] missmatch (-want +got):\n%s", diff)
115+
t.Errorf("[IMPORTANT, those are default metrics, can't change in 1.x] mismatch (-want +got):\n%s", diff)
116116
}
117117
}
118118

@@ -132,7 +132,7 @@ func TestWithGoCollectorMemStatsMetricsDisabled(t *testing.T) {
132132
}
133133

134134
if diff := cmp.Diff(got, withBaseMetrics(defaultRuntimeMetrics)); diff != "" {
135-
t.Errorf("missmatch (-want +got):\n%s", diff)
135+
t.Errorf("mismatch (-want +got):\n%s", diff)
136136
}
137137
}
138138

@@ -190,7 +190,7 @@ func TestGoCollectorAllowList(t *testing.T) {
190190
}
191191

192192
if diff := cmp.Diff(got, test.expected); diff != "" {
193-
t.Errorf("missmatch (-want +got):\n%s", diff)
193+
t.Errorf("mismatch (-want +got):\n%s", diff)
194194
}
195195
})
196196
}
@@ -252,7 +252,7 @@ func TestGoCollectorDenyList(t *testing.T) {
252252
}
253253

254254
if diff := cmp.Diff(got, test.expected); diff != "" {
255-
t.Errorf("missmatch (-want +got):\n%s", diff)
255+
t.Errorf("mismatch (-want +got):\n%s", diff)
256256
}
257257
})
258258
}

prometheus/collectors/version/version_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ func TestGoVersionCollector(t *testing.T) {
5656
}
5757

5858
if diff := cmp.Diff(lk, defaultLabels); diff != "" {
59-
t.Errorf("missmatch (-want +got):\n%s", diff)
59+
t.Errorf("mismatch (-want +got):\n%s", diff)
6060
}
6161

6262
}
6363

6464
if diff := cmp.Diff(got, []string{"foo_build_info"}); diff != "" {
65-
t.Errorf("missmatch (-want +got):\n%s", diff)
65+
t.Errorf("mismatch (-want +got):\n%s", diff)
6666
}
6767
}
6868

@@ -103,12 +103,12 @@ func TestGoVersionCollectorWithLabels(t *testing.T) {
103103
labels := append(defaultLabels, "z-mylabel")
104104

105105
if diff := cmp.Diff(lk, labels); diff != "" {
106-
t.Errorf("missmatch (-want +got):\n%s", diff)
106+
t.Errorf("mismatch (-want +got):\n%s", diff)
107107
}
108108

109109
}
110110

111111
if diff := cmp.Diff(got, []string{"foo_build_info"}); diff != "" {
112-
t.Errorf("missmatch (-want +got):\n%s", diff)
112+
t.Errorf("mismatch (-want +got):\n%s", diff)
113113
}
114114
}

prometheus/histogram.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ func (h *histogram) maybeReset(
970970
// We are using the possibly mocked h.now() rather than
971971
// time.Since(h.lastResetTime) to enable testing.
972972
if h.nativeHistogramMinResetDuration == 0 || // No reset configured.
973-
h.resetScheduled || // Do not interefere if a reset is already scheduled.
973+
h.resetScheduled || // Do not interfere if a reset is already scheduled.
974974
h.now().Sub(h.lastResetTime) < h.nativeHistogramMinResetDuration {
975975
return false
976976
}

prometheus/internal/difflib.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ type OpCode struct {
7878
// notion, pairing up elements that appear uniquely in each sequence.
7979
// That, and the method here, appear to yield more intuitive difference
8080
// reports than does diff. This method appears to be the least vulnerable
81-
// to synching up on blocks of "junk lines", though (like blank lines in
81+
// to syncing up on blocks of "junk lines", though (like blank lines in
8282
// ordinary text files, or maybe "<P>" lines in HTML files). That may be
8383
// because this is the only method of the 3 that has a *concept* of
8484
// "junk" <wink>.

0 commit comments

Comments
 (0)