Convert explicit zero comparison to a method. (#8475)

Fixes #8472.

I didn't see any other obvious cases of us doing this (although we do return zeroes in other places alongside errors, which is fine).
This commit is contained in:
M. J. Fromberger
2022-05-06 06:44:09 -07:00
committed by GitHub
parent ce40697ea6
commit ef44460c41

View File

@@ -279,8 +279,7 @@ func checkRequiredHeaderFields(h *types.SignedHeader) error {
return errors.New("height in trusted header must be set (non zero")
}
zeroTime := time.Time{}
if h.Time == zeroTime {
if h.Time.IsZero() {
return errors.New("time in trusted header must be set")
}