From e4cd5e4a5f82fcd63fa1d1e2cfdff0a2fce30396 Mon Sep 17 00:00:00 2001 From: Elias Bomberger Date: Sun, 17 Oct 2021 14:30:19 -0400 Subject: [PATCH] oops, missed a spot before run gofmt, remove an unused bit --- tree/tree.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tree/tree.go b/tree/tree.go index 9977a79..8c567ae 100644 --- a/tree/tree.go +++ b/tree/tree.go @@ -96,7 +96,7 @@ func Tree(hyphaName string) (siblingsHTML, childrenHTML, prev, next string) { wg.Done() }() go func() { - children = figureOutChildren(hyphaName, true).children + children = figureOutChildren(hyphaName).children wg.Done() }() wg.Wait() @@ -124,10 +124,10 @@ type child struct { children []child } -func figureOutChildren(hyphaName string, exists bool) child { +func figureOutChildren(hyphaName string) child { var ( descPrefix = hyphaName + "/" - child = child{hyphaName, true, make([]child, 0)} + child = child{hyphaName, true, make([]child, 0)} ) for desc := range hyphae.YieldExistingHyphae() { @@ -153,9 +153,9 @@ func addHyphaToChild(hyphaName, subPath string, child *child) { } else { var ( firstSlash = strings.IndexRune(subPath, '/') - firstDir = subPath[:firstSlash] - restOfPath = subPath[firstSlash + 1:] - subchild = findOrCreateSubchild(firstDir, child) + firstDir = subPath[:firstSlash] + restOfPath = subPath[firstSlash+1:] + subchild = findOrCreateSubchild(firstDir, child) ) addHyphaToChild(hyphaName, restOfPath, subchild) } @@ -172,7 +172,7 @@ func findOrCreateSubchild(name string, baseChild *child) *child { } } baseChild.children = append(baseChild.children, child{fullName, false, make([]child, 0)}) - return &baseChild.children[len(baseChild.children) - 1] + return &baseChild.children[len(baseChild.children)-1] } type sibling struct {