golang 方法, 接口, 继承 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 package main import "fmt" type Foo struct{ Field0 string Field1 string } type Bar struct{ Foo Field2 string Field3 string } func main(){ fmt.Println("hello") bar:=Bar{Field2: "f2",Field3: "f3"} bar.Field0="f0" fmt.Printf("%v",bar) } http://www.cnblogs.com/chenny7/p/4497969.html Go语言没有沿袭