Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for TestInterfaceSet (0.22 sec)

  1. src/encoding/json/decode_test.go

    	}
    }
    
    func intp(x int) *int {
    	p := new(int)
    	*p = x
    	return p
    }
    
    func intpp(x *int) **int {
    	pp := new(*int)
    	*pp = x
    	return pp
    }
    
    func TestInterfaceSet(t *testing.T) {
    	tests := []struct {
    		CaseName
    		pre  any
    		json string
    		post any
    	}{
    		{Name(""), "foo", `"bar"`, "bar"},
    		{Name(""), "foo", `2`, 2.0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 11 16:40:14 UTC 2024
    - 67.6K bytes
    - Viewed (0)
  2. 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