[NOD-1521] use staticcheck (#1015)

* [NOD-1521] Use static check as part of jenkins to check for swallowed errors

* [NOD-1521] added staticcheck installation

* [NOD-1521] Fix static check errors

Co-authored-by: Ori Newman <orinewman1@gmail.com>
This commit is contained in:
oudeis
2020-11-10 15:59:35 +00:00
committed by GitHub
parent 23c1ea6c31
commit 8290fadd3a
5 changed files with 15 additions and 5 deletions

View File

@@ -81,7 +81,7 @@ func TestLevelDBTransactionSanity(t *testing.T) {
// Get from the key previously put to. Since the tx is not
// yet committed, this should return ErrNotFound.
getData, err := ldb.Get(key)
_, err = ldb.Get(key)
if err == nil {
t.Fatalf("TestLevelDBTransactionSanity: Get " +
"unexpectedly succeeded")
@@ -100,7 +100,7 @@ func TestLevelDBTransactionSanity(t *testing.T) {
// Get from the key previously put to. Now that the tx was
// committed, this should succeed.
getData, err = ldb.Get(key)
getData, err := ldb.Get(key)
if err != nil {
t.Fatalf("TestLevelDBTransactionSanity: Get "+
"returned unexpected error: %s", err)