Skip to content

Commit

Permalink
change log fatal to panic
Browse files Browse the repository at this point in the history
Signed-off-by: André R. de Miranda <[email protected]>
  • Loading branch information
ribeiromiranda committed Sep 18, 2024
1 parent b864bb4 commit 047521c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions graph/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (n *Node) MarshalJSON() ([]byte, error) {

func (n *Node) Edge(name string) *Node {
if n.HasValue() {
log.Fatal("value alredy defined, execute clear first")
log.Panic("value already defined, execute clear first")
}
if _, ok := n.edges[name]; !ok {
newNode := NewNode()
Expand Down Expand Up @@ -100,7 +100,7 @@ func (n *Node) SetBool(value bool) *Node {

func (n *Node) setValue(value any) {
if len(n.edges) > 0 {
log.Fatal("alredy defined edges, execute clear fist")
log.Panic("already defined edges, execute clear fist")
}
n.value = value
}
Expand Down
1 change: 0 additions & 1 deletion graph/unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ func loadExternalResource(url string) (b []byte, err error) {
return
}

// TODO: optimize this
// NOTE: In specification, we can declare independent definitions with another file format, so
// we must convert independently yaml source to json format data before unmarshal.
if !json.Valid(b) {
Expand Down

0 comments on commit 047521c

Please sign in to comment.