MapFunc is now Node->Node

Save time creating a map for the results which contains at most one entry
This commit is contained in:
Bryan Boreham
2018-04-09 11:53:20 +00:00
parent ced27b298c
commit e3539a8d92
5 changed files with 32 additions and 33 deletions

View File

@@ -43,7 +43,7 @@ type testcase struct {
}
func testMap(t *testing.T, f render.MapFunc, input testcase) {
if have := f(input.n); input.ok != (len(have) > 0) {
if have := f(input.n); input.ok != (have.ID != "") {
name := input.name
if name == "" {
name = fmt.Sprintf("%v", input.n)