Get coverage on IsStructMap methods with a hack.

This commit is contained in:
Qi Xiao 2022-06-20 22:08:19 +01:00
parent 400ada5c86
commit e0292dd298

View File

@ -13,6 +13,11 @@ type Tester struct {
// TestValue returns a ValueTester.
func TestValue(t *testing.T, v any) Tester {
// Hack to get test coverage on the marker method IsStructMap, which is
// never invoked.
if m, ok := v.(StructMap); ok {
m.IsStructMap()
}
return Tester{t, v}
}