path: add a comment on dropping error in ResolveToLastNode
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
Łukasz Magiera committed
Jul 23, 2018 at 21:29 UTC
d493624476ba14328b6a6c71758150e384933a36
1 file changed
+4
path/resolver/resolver.go
+4
@@ -70,6 +70,10 @@ func (r *Resolver) ResolveToLastNode(ctx context.Context, fpath path.Path) (ipld
70
71
for len(p) > 0 {
72
lnk, rest, err := r.ResolveOnce(ctx, r.DAG, nd, p)
73
+
74
+ // Note: have to drop the error here as `ResolveOnce` doesn't handle 'leaf'
75
+ // paths (so e.g. for `echo '{"foo":123}' | ipfs dag put` we wouldn't be
76
+ // able to resolve `zdpu[...]/foo`)
77
if lnk == nil {
78
break
79
}