From 95595c1aa4ac2b2b8693648ed27631f99861947f Mon Sep 17 00:00:00 2001 From: Hlib Date: Mon, 25 May 2020 17:21:35 +0800 Subject: [PATCH] add GetIPLDNode() method to NavigableNode --- navipld.go | 2 +- walker.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/navipld.go b/navipld.go index 1298673..eed3e51 100644 --- a/navipld.go +++ b/navipld.go @@ -134,7 +134,7 @@ func (nn *NavigableIPLDNode) ChildTotal() uint { // function. // TODO: Check for errors to avoid a panic? func ExtractIPLDNode(node NavigableNode) Node { - return node.(*NavigableIPLDNode).GetIPLDNode() + return node.GetIPLDNode() } // TODO: `Cleanup` is not supported at the moment in the `Walker`. diff --git a/walker.go b/walker.go index 8138093..6b5d7db 100644 --- a/walker.go +++ b/walker.go @@ -116,6 +116,9 @@ type NavigableNode interface { // ChildTotal returns the number of children of the `ActiveNode`. ChildTotal() uint + // GetIPLDNode returns actual IPLD Node + GetIPLDNode() Node + // TODO: Evaluate providing the `Cleanup` and `Reset` methods. // Cleanup is an optional method that is called by the `Walker` when