goraph
goraph copied to clipboard
Export an Error to signify missing nodes
goraph uses errors.New()
to create errors to signal missing graph nodes in numerous places. e.g.
return fmt.Errorf("%s does not exist in the graph.", id1)
It would be better to create specific error type instead. This would reduce code duplication and would allow callers to distinguish missing nodes from other things that may have go wrong when using the library.
Could you send a PR to implement this? Thanks!
I'll try to get something out within the next week.