Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumGotable-driven testsSingle-choice MCQ

A table-driven test uses `cmp.Diff` from go-cmp to compare structs with unexported fields. The test panics at runtime. What is the most likely cause?

type point struct{ x, y int } // ... if diff := cmp.Diff(want, got); diff != "" { t.Errorf("mismatch (-want +got):\n%s", diff) }