1
0
mirror of https://github.com/golang/go synced 2024-11-23 05:30:07 -07:00

log: make the name of error clearer

The variable named `err4` is a bit confusing, `err` will be better.
This commit is contained in:
royeo 2019-01-25 10:01:22 +08:00
parent 9d23975d89
commit b5cf80bf9d

View File

@ -61,9 +61,9 @@ func testPrint(t *testing.T, flag int, prefix string, pattern string, useFormat
line := buf.String()
line = line[0 : len(line)-1]
pattern = "^" + pattern + "hello 23 world$"
matched, err4 := regexp.MatchString(pattern, line)
if err4 != nil {
t.Fatal("pattern did not compile:", err4)
matched, err := regexp.MatchString(pattern, line)
if err != nil {
t.Fatal("pattern did not compile:", err)
}
if !matched {
t.Errorf("log output should match %q is %q", pattern, line)