diff --git a/internal/repository/index.go b/internal/repository/index.go index b247342e7..5164a4703 100644 --- a/internal/repository/index.go +++ b/internal/repository/index.go @@ -515,11 +515,8 @@ func (idx *Index) merge(idx2 *Index) error { // isErrOldIndex returns true if the error may be caused by an old index // format. func isErrOldIndex(err error) bool { - if e, ok := err.(*json.UnmarshalTypeError); ok && e.Value == "array" { - return true - } - - return false + e, ok := err.(*json.UnmarshalTypeError) + return ok && e.Value == "array" } // DecodeIndex unserializes an index from buf.