1
0
mirror of https://github.com/golang/go synced 2024-11-23 18:40:03 -07:00

cmd/compile: remove unnecessary error condition on reading fingerprint

io.ReadFull guarantees n == len(buf) if and only if err == nil,
so the length check is redundant.

Change-Id: I15bff97868e27a65648acd791883cac8dab77630
Reviewed-on: https://go-review.googlesource.com/c/go/+/232988
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This commit is contained in:
Cherry Zhang 2020-05-08 17:12:45 -04:00
parent e7c7ce646f
commit 84a62453e5

View File

@ -191,9 +191,9 @@ func iimport(pkg *types.Pkg, in *bio.Reader) (fingerprint goobj.FingerprintType)
}
}
// Fingerprint
n, err := io.ReadFull(in, fingerprint[:])
if err != nil || n != len(fingerprint) {
// Fingerprint.
_, err = io.ReadFull(in, fingerprint[:])
if err != nil {
yyerror("import %s: error reading fingerprint", pkg.Path)
errorexit()
}