From e4023df2f0cecef7aae93ee9c44848fe359e6611 Mon Sep 17 00:00:00 2001 From: 3pCode Date: Sun, 21 Oct 2018 07:06:48 -0400 Subject: [PATCH] update test to check all return codes, update variable name. --- graph/graphtest/graphtest.go | 6 ++++-- graph/kv/indexing.go | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/graph/graphtest/graphtest.go b/graph/graphtest/graphtest.go index 4a0a61a02..007f3c5ad 100644 --- a/graph/graphtest/graphtest.go +++ b/graph/graphtest/graphtest.go @@ -1103,11 +1103,13 @@ func TestDeleteReinserted(t testing.TB, gen testutil.DatabaseFunc, _ *Config) { quad.Make("", "", "Feeling happy", nil), quad.Make("", "", "", nil), }) + require.NoError(t, err, "Add quadset failed") for i := 0; i < 2; i++ { - w.AddQuad(quad.Make("", "", "", nil)) + err = w.AddQuad(quad.Make("", "", "", nil)) + require.NoError(t, err, "Add quad failed") err = w.RemoveQuad(quad.Make("", "", "", nil)) - assert.Nil(t, err, "Remove quad failed") + require.NoError(t, err, "Remove quad failed") } } diff --git a/graph/kv/indexing.go b/graph/kv/indexing.go index 3120c13fe..72d94254f 100644 --- a/graph/kv/indexing.go +++ b/graph/kv/indexing.go @@ -675,9 +675,9 @@ func (qs *QuadStore) hasPrimitive(ctx context.Context, tx BucketTx, p *proto.Pri if !get && unique { return p, nil } - for ix := len(options) - 1; ix >= 0; ix-- { + for i := len(options) - 1; i >= 0; i-- { // TODO: batch - prim, err := qs.getPrimitiveFromLog(ctx, tx, options[ix]) + prim, err := qs.getPrimitiveFromLog(ctx, tx, options[i]) if err != nil { return nil, err