From 4ec6216dfbe18c41ab368bec422b3d54c421e564 Mon Sep 17 00:00:00 2001 From: Fabio Barone Date: Wed, 5 Apr 2017 09:14:38 -0500 Subject: [PATCH] swarm/api: Println had %s but no substitution --- swarm/api/api.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/swarm/api/api.go b/swarm/api/api.go index 50b6660daf..4b3c5926df 100644 --- a/swarm/api/api.go +++ b/swarm/api/api.go @@ -99,7 +99,23 @@ func (self *Api) Resolve(uri *URI) (storage.Key, error) { return storage.Key(common.Hex2Bytes(uri.Addr)), nil } if err != nil { +<<<<<<< HEAD return nil, fmt.Errorf("'%s' does not resolve: %v but is not a content hash", uri.Addr, err) +======= + return nil, fmt.Errorf("'%s' does not resolve: %v but is not a content hash", hostPort, err) + } + return nil, fmt.Errorf("'%s' is not a content hash", hostPort) +} + +func Parse(uri string) (hostPort, path string) { + if uri == "" { + return + } + parts := slashes.Split(uri, 3) + var i int + if len(parts) == 0 { + return +>>>>>>> swarm/api: Println had %s but no substitution } return nil, fmt.Errorf("'%s' is not a content hash", uri.Addr) }