Closed davidmat50 closed 1 year ago
This might be better:
if choice, ok := p.(*Choice); ok { if c, found := choice.Cases()[path]; found { return c } return nil }
returning null is ok, just means path doesn't point to a definition.
Can you also add a check to TestFindChoice in find_test.go to find a case returns the case and not finding a case returns nil?
something like:
fc.AssertEqual(t, c1, Find(m, "c/one")) fc.AssertEqual(t, nil, Find(m, "c/bogus"))
The suggested changes and UTs were done. If there anything else to be done. If eveything is fine, can you merge the changes to main master branch.
This might be better:
returning null is ok, just means path doesn't point to a definition.
Can you also add a check to TestFindChoice in find_test.go to find a case returns the case and not finding a case returns nil?
something like: