Skip to content

Commit f169139

Browse files
committed
Calling NewNode() and NewType() instead of Node() and Type()
1 parent 13f891a commit f169139

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

triple/node/node.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,12 @@ func Parse(s string) (*Node, error) {
101101
}
102102
return NewNode(t, id), nil
103103
case underscore:
104-
id := ID(raw[2:len(raw)])
105-
t := Type("/_")
106-
return NewNode(&t, &id), nil
104+
id, err := NewID(raw[2:len(raw)])
105+
if err != nil {
106+
return nil, fmt.Errorf("node.Parser: invalid ID in %q, %v", raw, err)
107+
}
108+
t, _ := NewType("/_")
109+
return NewNode(t, id), nil
107110
default:
108111
return nil, fmt.Errorf("node.Parser: node representation should start with '/' or '_' in %v", raw)
109112
}

0 commit comments

Comments
 (0)