Skip to content

Commit

Permalink
Cleanup lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
iknite committed Mar 14, 2019
1 parent 4aaf38b commit 63ef719
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions balloon/balloon.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,13 @@ func (b Balloon) QueryDigestMembership(keyDigest hashing.Digest, version uint64)
leaf, err = b.store.Get(storage.IndexPrefix, proof.KeyDigest)
switch {
case err != nil && err != storage.ErrKeyNotFound:
return nil, fmt.Errorf("Error reading leaf %v data: %v", proof.KeyDigest, err)
return nil, fmt.Errorf("error reading leaf %v data: %v", proof.KeyDigest, err)

case err != nil && err == storage.ErrKeyNotFound:
proof.Exists = false
proof.ActualVersion = version
leaf = &storage.KVPair{keyDigest, util.Uint64AsBytes(version)}
leaf = &storage.KVPair{Key: keyDigest, Value: util.Uint64AsBytes(version)}

case err == nil:
proof.Exists = true
proof.ActualVersion = util.BytesAsUint64(leaf.Value)
Expand All @@ -290,11 +292,11 @@ func (b Balloon) QueryDigestMembership(keyDigest hashing.Digest, version uint64)

wg.Wait()
if hyperErr != nil {
return nil, fmt.Errorf("Unable to get proof from hyper tree: %v", err)
return nil, fmt.Errorf("unable to get proof from hyper tree: %v", err)
}

if historyErr != nil {
return nil, fmt.Errorf("Unable to get proof from history tree: %v", err)
return nil, fmt.Errorf("unable to get proof from history tree: %v", err)
}

proof.HyperProof = hyperProof
Expand Down Expand Up @@ -324,7 +326,7 @@ func (b Balloon) QueryConsistency(start, end uint64) (*IncrementalProof, error)

historyProof, err := b.historyTree.ProveConsistency(start, end)
if err != nil {
return nil, fmt.Errorf("Unable to get proof from history tree: %v", err)
return nil, fmt.Errorf("unable to get proof from history tree: %v", err)
}
proof.AuditPath = historyProof.AuditPath

Expand Down

0 comments on commit 63ef719

Please sign in to comment.