i am using following code...
package main
import (
"fmt"
)
type traingle interface {
area() int
}
type details struct {
height int
base int
}
func (a details) area() int {
s := a.height + a.base
fmt.Println("the area is", s)
return s
}
func main() {
r := details{height: 3, base: 4}
var p1 traingle
p1.area(r)
}
not getting why getting following error
too many arguments in call to p1.area have (details) want ()
i am assuming that p1 object of triangle can call area() method with arguments. not getting why it is failing.