Skip to content

Commit d1d3c13

Browse files
committed
chore: Address review comments
Signed-off-by: Kemal Akkoyun <[email protected]>
1 parent ed49386 commit d1d3c13

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/injector/typed/typecheck.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,9 @@ func validateTypeNameIsInterface(obj types.Object, fullName string, pkgPath stri
113113
}
114114

115115
// Since types.IsInterface passed, we can safely cast typ.Underlying() to *types.Interface
116-
return typ.Underlying().(*types.Interface), nil
116+
t, ok := typ.Underlying().(*types.Interface)
117+
if !ok {
118+
return nil, fmt.Errorf("type %s is not an interface", fullName)
119+
}
120+
return t, nil
117121
}

0 commit comments

Comments
 (0)