package main import "fmt" type Reader interface { ReadBook() } type Writer interface { WriteBook() } // 具体类型 type Book struct { } func (this *Book) ReadBook() { fmt.Println("Read a Book") } func (this *Book) WriteBook() { fmt.Println("Write a Book") } func main() { // b: pair b := &Book{} // r: pair var r Reader // r: pair r = b r.ReadBook() var w Writer // r: pair w = r.(Writer) // 此处的断方为什么会成功?因为w r的具体type是一致的 w.WriteBook() }