1. type F interface {
    2. f()
    3. }
    4.  
    5. type S1 struct{}
    6.  
    7. func (s S1) f() {}
    8. type S2 struct{}
    9.  
    10. func (s *S2) f() {}
    11.  
    12. s1Val := S1{}
    13. s1Ptr := &S1{}
    14. s2Val := S2{}
    15.  
    16. var i F
    17. i = s1Val
    18. i = s1Ptr
    19. i = s2Ptr
    20.  
    21. // The following doesn't compile, since s2Val is a value, and there is no value receiver for f.