Skip to content

Commit c548086

Browse files
Abirdcflychrisberkhout
authored andcommitted
[Heartbeat] fix minor unreachable code (#32659)
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
1 parent f66c196 commit c548086

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

filebeat/input/file/glob_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,14 @@ func TestGlob(t *testing.T) {
3434
if err != nil {
3535
t.Fatal(err)
3636
}
37-
os.MkdirAll(filepath.Join(root, "foo/bar/baz/qux/quux"), 0o755)
37+
if err := os.MkdirAll(filepath.Join(root, "foo/bar/baz/qux/quux"), 0o755); err != nil {
38+
t.Fatal(err)
39+
}
3840
for _, test := range globTests {
3941
pattern := filepath.Join(root, test.pattern)
4042
matches, err := Glob(pattern, 4)
4143
if err != nil {
4244
t.Fatal(err)
43-
continue
4445
}
4546
var normalizedMatches []string
4647
for _, m := range matches {
@@ -92,7 +93,6 @@ func TestGlobPatterns(t *testing.T) {
9293
for i, p := range patterns {
9394
if p != test.expectedPatterns[i] {
9495
t.Fatalf("%q expanded to %q instead of %q", test.pattern, patterns, test.expectedPatterns)
95-
break
9696
}
9797
}
9898
}

filebeat/input/syslog/rfc3164_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,6 @@ func TestPriority(t *testing.T) {
793793
ParserRFC3164([]byte(log), l)
794794
assert.Equal(t, d, l.Priority())
795795
})
796-
return
797796
}
798797
}
799798

0 commit comments

Comments
 (0)