diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-08-15 00:44:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-15 00:44:17 +0800 |
commit | 2403656373f1250e3668227bd9fc94e6e95412b9 (patch) | |
tree | 53ddfebc6a77ea7b8a3f7ac81c58baa8168f729e /swarm/api/api.go | |
parent | ef0edc6e32d98d2fca54076f38cb317f43704900 (diff) | |
parent | 133de3d80659680dc051065cb3baddd92a4e45c5 (diff) | |
download | go-tangerine-2403656373f1250e3668227bd9fc94e6e95412b9.tar go-tangerine-2403656373f1250e3668227bd9fc94e6e95412b9.tar.gz go-tangerine-2403656373f1250e3668227bd9fc94e6e95412b9.tar.bz2 go-tangerine-2403656373f1250e3668227bd9fc94e6e95412b9.tar.lz go-tangerine-2403656373f1250e3668227bd9fc94e6e95412b9.tar.xz go-tangerine-2403656373f1250e3668227bd9fc94e6e95412b9.tar.zst go-tangerine-2403656373f1250e3668227bd9fc94e6e95412b9.zip |
Merge pull request #14951 from egonelbre/megacheck_swarm
swarm: fix megacheck warnings
Diffstat (limited to 'swarm/api/api.go')
-rw-r--r-- | swarm/api/api.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/swarm/api/api.go b/swarm/api/api.go index 803265a3e..7d185ab3c 100644 --- a/swarm/api/api.go +++ b/swarm/api/api.go @@ -34,11 +34,7 @@ import ( "github.com/ethereum/go-ethereum/swarm/storage" ) -var ( - hashMatcher = regexp.MustCompile("^[0-9A-Fa-f]{64}") - slashes = regexp.MustCompile("/+") - domainAndVersion = regexp.MustCompile("[@:;,]+") -) +var hashMatcher = regexp.MustCompile("^[0-9A-Fa-f]{64}") type Resolver interface { Resolve(string) (common.Hash, error) @@ -335,7 +331,6 @@ func (self *Api) AppendFile(mhash, path, fname string, existingSize int64, conte } func (self *Api) BuildDirectoryTree(mhash string, nameresolver bool) (key storage.Key, manifestEntryMap map[string]*manifestTrieEntry, err error) { - uri, err := Parse("bzz:/" + mhash) if err != nil { return nil, nil, err @@ -356,5 +351,8 @@ func (self *Api) BuildDirectoryTree(mhash string, nameresolver bool) (key storag manifestEntryMap[suffix] = entry }) + if err != nil { + return nil, nil, fmt.Errorf("list with prefix failed %v: %v", key.String(), err) + } return key, manifestEntryMap, nil } |