Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestInterfaceSet (0.1 sec)

  1. src/reflect/all_test.go

    	CheckI("&t2", &t2, 40)
    	CheckI("t1", t1, 40)
    	CheckI("&t1", &t1, 40)
    
    	var tnil Tinter
    	vnil := ValueOf(&tnil).Elem()
    	shouldPanic("Method", func() { vnil.Method(0) })
    }
    
    func TestInterfaceSet(t *testing.T) {
    	p := &Point{3, 4}
    
    	var s struct {
    		I any
    		P interface {
    			Dist(int) int
    		}
    	}
    	sv := ValueOf(&s).Elem()
    	sv.Field(0).Set(ValueOf(p))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
Back to top