refactor: simplify Node struct with public Tags/Relations fields

This commit is contained in:
2026-04-01 00:13:43 +02:00
parent 4020e5dab3
commit 77d3205e12
3 changed files with 40 additions and 103 deletions

View File

@@ -77,7 +77,7 @@ func PrintNodes(w io.Writer, svc service.NodeService, nodes []*models.Node, json
})
for _, n := range nodes {
n_rels := n.Relations()
n_rels := n.Relations
ns_rel_node_ids := n_rels[string(models.RelInNamespace)]
ns_rel_node_titles := make([]string, 0, len(ns_rel_node_ids))
for _, id := range ns_rel_node_ids {
@@ -125,7 +125,7 @@ func PrintNode(w io.Writer, svc service.NodeService, n *models.Node, jsonOut boo
fmt.Fprintf(w, "\n tags: %s\n", cPrimary.Sprint(strings.Join(tags, " • ")))
}
n_rels := n.Relations()
n_rels := n.Relations
for relType := range n_rels {
rel_node_ids := n_rels[string(relType)]
if len(rel_node_ids) > 0 {