go语言编程模式总结 面向对象最佳实践 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 type Shape interface { Sides() int Area() int } type Square struct { len int } func (s* Square) Sides() int { return 4 } func main() { s := Square{len: 5} fmt.Printf("%d\n",s.Sides()) } Square 并没