1. import (
    2. "fmt"
    3. "math"
    4. )
    5. type I interface {
    6. M()
    7. }
    8. type T struct {
    9. func (t *T) M() {
    10. fmt.Println(t.S)
    11. }
    12. type F float64
    13. func (f F) M() {
    14. fmt.Println(f)
    15. }
    16. i = &T{"Hello"}
    17. describe(i)
    18. i.M()
    19. i = F(math.Pi)
    20. describe(i)
    21. i.M()
    22. }
    23. func describe(i I) {