aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/xml
diff options
context:
space:
mode:
authorAlan Donovan <adonovan@google.com>2023-04-19 18:48:00 -0400
committerGopher Robot <gobot@golang.org>2023-04-20 01:07:29 +0000
commit9d35ebba062cae9cc7bd716ad279ac7d44060a93 (patch)
tree65616ae5f51f4c556dfacb2ae1f34bb00baf6844 /src/encoding/xml
parent5c865c78c378548c282b22d96e6d0375079d4417 (diff)
downloadgo-9d35ebba062cae9cc7bd716ad279ac7d44060a93.tar.xz
std: fix various nilness findings
Found by running $ go run golang.org/x/tools/go/analysis/passes/nilness/cmd/nilness@latest std No actual bugs--other than one panic(nil)--but a few places where error nilness was unclear. Change-Id: Ia916ba30f46f29c1bcf928cc62280169b922463a Reviewed-on: https://go-review.googlesource.com/c/go/+/486675 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Alan Donovan <adonovan@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Auto-Submit: Alan Donovan <adonovan@google.com>
Diffstat (limited to 'src/encoding/xml')
-rw-r--r--src/encoding/xml/xml_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/encoding/xml/xml_test.go b/src/encoding/xml/xml_test.go
index 8205ac3148..f5c7259cfb 100644
--- a/src/encoding/xml/xml_test.go
+++ b/src/encoding/xml/xml_test.go
@@ -1359,8 +1359,9 @@ func TestParseErrors(t *testing.T) {
}
continue
}
- if err == nil || err == io.EOF {
- t.Errorf("parse %s: have no error, expected a non-nil error", test.src)
+ // Inv: err != nil
+ if err == io.EOF {
+ t.Errorf("parse %s: unexpected EOF", test.src)
continue
}
if !strings.Contains(err.Error(), test.err) {