swarm, cmd/swarm: address ineffectual assignments (#18048)

* swarm, cmd/swarm: address ineffectual assignments

* swarm/network: remove unused vars from testHandshake

* swarm/storage/feed: revert cursor changes
This commit is contained in:
Anton Evangelatov
2018-11-07 20:39:08 +01:00
committed by Viktor Trón
parent 81533deae5
commit cf3b187bde
20 changed files with 61 additions and 24 deletions

View File

@@ -69,7 +69,7 @@ func (s *DBStore) Get(key string, i interface{}) (err error) {
// Put stores an object that implements Binary for a specific key.
func (s *DBStore) Put(key string, i interface{}) (err error) {
bytes := []byte{}
var bytes []byte
marshaler, ok := i.(encoding.BinaryMarshaler)
if !ok {

View File

@@ -112,6 +112,9 @@ func testPersistedStore(t *testing.T, store Store) {
as := []string{}
err = store.Get("key2", &as)
if err != nil {
t.Fatal(err)
}
if len(as) != 3 {
t.Fatalf("serialized array did not match expectation")

View File

@@ -59,7 +59,7 @@ func (s *InmemoryStore) Get(key string, i interface{}) (err error) {
func (s *InmemoryStore) Put(key string, i interface{}) (err error) {
s.mu.Lock()
defer s.mu.Unlock()
bytes := []byte{}
var bytes []byte
marshaler, ok := i.(encoding.BinaryMarshaler)
if !ok {