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 ""
}
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 "" }