You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into this issue while testing out the interface examples.
./interface_impl3.go:83:37: s.area undefined (type interface {} is interface with no methods)
To workaround the issue, I modified the shapeInfo func.
func shapeInfo(s interface{}) string {
if str, ok := s.(shape); ok {
return fmt.Sprintf("Area = %.2f", str.(shape).area())
}
return ""
}
The text was updated successfully, but these errors were encountered:
Hi Vladimir,
I ran into this issue while testing out the interface examples.
./interface_impl3.go:83:37: s.area undefined (type interface {} is interface with no methods)
To workaround the issue, I modified the shapeInfo func.
func shapeInfo(s interface{}) string {
if str, ok := s.(shape); ok {
return fmt.Sprintf("Area = %.2f", str.(shape).area())
}
return ""
}
The text was updated successfully, but these errors were encountered: