aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/state
diff options
context:
space:
mode:
authorAnton Evangelatov <anton.evangelatov@gmail.com>2018-11-08 03:39:08 +0800
committerViktor TrĂ³n <viktor.tron@gmail.com>2018-11-08 03:39:08 +0800
commitcf3b187bdef59078ba6570a2f5ee046ab87bcefd (patch)
treefbc16d9216df0d32e745f88cb3ac22e6dab256bf /swarm/state
parent81533deae5ee4a7ec08842e2b6647f3affde5a71 (diff)
downloadgo-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar
go-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.gz
go-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.bz2
go-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.lz
go-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.xz
go-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.tar.zst
go-tangerine-cf3b187bdef59078ba6570a2f5ee046ab87bcefd.zip
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
Diffstat (limited to 'swarm/state')
-rw-r--r--swarm/state/dbstore.go2
-rw-r--r--swarm/state/dbstore_test.go3
-rw-r--r--swarm/state/inmemorystore.go2
3 files changed, 5 insertions, 2 deletions
diff --git a/swarm/state/dbstore.go b/swarm/state/dbstore.go
index 5e5c172b2..b0aa92e27 100644
--- a/swarm/state/dbstore.go
+++ b/swarm/state/dbstore.go
@@ -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 {
diff --git a/swarm/state/dbstore_test.go b/swarm/state/dbstore_test.go
index 6683e788f..f7098956d 100644
--- a/swarm/state/dbstore_test.go
+++ b/swarm/state/dbstore_test.go
@@ -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")
diff --git a/swarm/state/inmemorystore.go b/swarm/state/inmemorystore.go
index 1ca25404a..3ba48592b 100644
--- a/swarm/state/inmemorystore.go
+++ b/swarm/state/inmemorystore.go
@@ -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 {