aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/swarm
diff options
context:
space:
mode:
authorRoc Yu <rociiu0112@gmail.com>2018-10-29 17:00:00 +0800
committerAnton Evangelatov <anton.evangelatov@gmail.com>2018-10-29 17:00:00 +0800
commit3e1cfbae934f72c94c00e515ca872997530eede8 (patch)
tree6b79bb60f61d155f4770d2d875c1ba8e68d82795 /cmd/swarm
parent54f650a3be2ccf7cd44e9929e3e132ef93f101ad (diff)
downloadgo-tangerine-3e1cfbae934f72c94c00e515ca872997530eede8.tar
go-tangerine-3e1cfbae934f72c94c00e515ca872997530eede8.tar.gz
go-tangerine-3e1cfbae934f72c94c00e515ca872997530eede8.tar.bz2
go-tangerine-3e1cfbae934f72c94c00e515ca872997530eede8.tar.lz
go-tangerine-3e1cfbae934f72c94c00e515ca872997530eede8.tar.xz
go-tangerine-3e1cfbae934f72c94c00e515ca872997530eede8.tar.zst
go-tangerine-3e1cfbae934f72c94c00e515ca872997530eede8.zip
cmd/swarm/swarm-smoke: fix issue that loop variable capture in func (#17992)
Diffstat (limited to 'cmd/swarm')
-rw-r--r--cmd/swarm/swarm-smoke/feed_upload_and_sync.go13
1 files changed, 5 insertions, 8 deletions
diff --git a/cmd/swarm/swarm-smoke/feed_upload_and_sync.go b/cmd/swarm/swarm-smoke/feed_upload_and_sync.go
index c7a1475d6..1371d6654 100644
--- a/cmd/swarm/swarm-smoke/feed_upload_and_sync.go
+++ b/cmd/swarm/swarm-smoke/feed_upload_and_sync.go
@@ -13,16 +13,13 @@ import (
"sync"
"time"
- "github.com/pborman/uuid"
-
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/swarm/multihash"
"github.com/ethereum/go-ethereum/swarm/storage/feed"
-
colorable "github.com/mattn/go-colorable"
-
+ "github.com/pborman/uuid"
cli "gopkg.in/urfave/cli.v1"
)
@@ -190,7 +187,7 @@ func cliFeedUploadAndSync(c *cli.Context) error {
for _, hex := range []string{topicHex, subTopicOnlyHex, mergedSubTopicHex} {
wg.Add(1)
ruid := uuid.New()[:8]
- go func(endpoint string, ruid string) {
+ go func(hex string, endpoint string, ruid string) {
for {
err := fetchFeed(hex, userHex, endpoint, dataHash, ruid)
if err != nil {
@@ -200,7 +197,7 @@ func cliFeedUploadAndSync(c *cli.Context) error {
wg.Done()
return
}
- }(endpoint, ruid)
+ }(hex, endpoint, ruid)
}
}
@@ -268,7 +265,7 @@ func cliFeedUploadAndSync(c *cli.Context) error {
for _, url := range []string{manifestWithTopic, manifestWithSubTopic, manifestWithMergedTopic} {
wg.Add(1)
ruid := uuid.New()[:8]
- go func(endpoint string, ruid string) {
+ go func(url string, endpoint string, ruid string) {
for {
err := fetch(url, endpoint, fileHash, ruid)
if err != nil {
@@ -278,7 +275,7 @@ func cliFeedUploadAndSync(c *cli.Context) error {
wg.Done()
return
}
- }(endpoint, ruid)
+ }(url, endpoint, ruid)
}
}