Commit ca630163 authored by Kirill Smelkov's avatar Kirill Smelkov

go/zodb/btree: Fix missing return on data-consistency error

staticcheck reports

    ziobtree.go:606:4: Errorf is a pure function but its return value is ignored (SA4017)
    ziobtree.go:626:4: Errorf is a pure function but its return value is ignored (SA4017)
    zlobtree.go:606:4: Errorf is a pure function but its return value is ignored (SA4017)
    zlobtree.go:626:4: Errorf is a pure function but its return value is ignored (SA4017)
parent 3d27ed5d
// Copyright (c) 2001, 2002 Zope Foundation and Contributors.
// All Rights Reserved.
//
// Copyright (C) 2018-2019 Nexedi SA and Contributors.
// Copyright (C) 2018-2021 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This software is subject to the provisions of the Zope Public License,
......@@ -601,7 +601,7 @@ func (bt *btreeState) PySetState(pystate interface{}) (err error) {
}
if i > 1 && !(key > kprev) {
fmt.Errorf("data: [%d]: key not ↑", i)
return fmt.Errorf("data: [%d]: key not ↑", i)
}
kprev = key
......@@ -621,7 +621,7 @@ func (bt *btreeState) PySetState(pystate interface{}) (err error) {
childrenKind = kind
}
if kind != childrenKind {
fmt.Errorf("data: [%d]: children must be of the same type", i)
return fmt.Errorf("data: [%d]: children must be of the same type", i)
}
bt.data = append(bt.data, Entry{key: kkey, child: child.(Node)})
......
......@@ -3,7 +3,7 @@
// Copyright (c) 2001, 2002 Zope Foundation and Contributors.
// All Rights Reserved.
//
// Copyright (C) 2018-2019 Nexedi SA and Contributors.
// Copyright (C) 2018-2021 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This software is subject to the provisions of the Zope Public License,
......@@ -603,7 +603,7 @@ func (bt *iobtreeState) PySetState(pystate interface{}) (err error) {
}
if i > 1 && !(key > kprev) {
fmt.Errorf("data: [%d]: key not ↑", i)
return fmt.Errorf("data: [%d]: key not ↑", i)
}
kprev = key
......@@ -623,7 +623,7 @@ func (bt *iobtreeState) PySetState(pystate interface{}) (err error) {
childrenKind = kind
}
if kind != childrenKind {
fmt.Errorf("data: [%d]: children must be of the same type", i)
return fmt.Errorf("data: [%d]: children must be of the same type", i)
}
bt.data = append(bt.data, IOEntry{key: kkey, child: child.(IONode)})
......
......@@ -3,7 +3,7 @@
// Copyright (c) 2001, 2002 Zope Foundation and Contributors.
// All Rights Reserved.
//
// Copyright (C) 2018-2019 Nexedi SA and Contributors.
// Copyright (C) 2018-2021 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This software is subject to the provisions of the Zope Public License,
......@@ -603,7 +603,7 @@ func (bt *lobtreeState) PySetState(pystate interface{}) (err error) {
}
if i > 1 && !(key > kprev) {
fmt.Errorf("data: [%d]: key not ↑", i)
return fmt.Errorf("data: [%d]: key not ↑", i)
}
kprev = key
......@@ -623,7 +623,7 @@ func (bt *lobtreeState) PySetState(pystate interface{}) (err error) {
childrenKind = kind
}
if kind != childrenKind {
fmt.Errorf("data: [%d]: children must be of the same type", i)
return fmt.Errorf("data: [%d]: children must be of the same type", i)
}
bt.data = append(bt.data, LOEntry{key: kkey, child: child.(LONode)})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment