Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for NumField (0.1 sec)

  1. src/reflect/value.go

    		return Value{}
    	}
    	m, ok := toRType(v.typ()).MethodByName(name)
    	if !ok {
    		return Value{}
    	}
    	return v.Method(m.Index)
    }
    
    // NumField returns the number of fields in the struct v.
    // It panics if v's Kind is not [Struct].
    func (v Value) NumField() int {
    	v.mustBe(Struct)
    	tt := (*structType)(unsafe.Pointer(v.typ()))
    	return len(tt.Fields)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
  2. src/reflect/all_test.go

    	shouldPanic("call of reflect.Value.Method on zero Value", func() { vo(nil).Method(0) })
    	shouldPanic("call of reflect.Value.NumField on string Value", func() { vo("").NumField() })
    	shouldPanic("call of reflect.Value.NumMethod on zero Value", func() { vo(nil).NumMethod() })
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
  3. pkg/api/pod/util_test.go

    		// ObjectMeta is generic and therefore should never have a field with a specific resource's name;
    		// it contains cycles so it's easiest to just skip it.
    		if name == "ObjectMeta" {
    			break
    		}
    		for i := 0; i < tp.NumField(); i++ {
    			field := tp.Field(i)
    			resourcePaths.Insert(sets.List[string](collectResourcePaths(t, resourcename, path.Child(field.Name), field.Name, field.Type))...)
    		}
    	case reflect.Interface:
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed May 29 22:40:29 UTC 2024
    - 108.8K bytes
    - Viewed (0)
  4. src/net/http/transport_test.go

    		},
    		ReadBufferSize:  1,
    		WriteBufferSize: 1,
    	}
    	tr2 := tr.Clone()
    	rv := reflect.ValueOf(tr2).Elem()
    	rt := rv.Type()
    	for i := 0; i < rt.NumField(); i++ {
    		sf := rt.Field(i)
    		if !token.IsExported(sf.Name) {
    			continue
    		}
    		if rv.Field(i).IsZero() {
    			t.Errorf("cloned field t2.%s is zero", sf.Name)
    		}
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 21:59:21 UTC 2024
    - 192.6K bytes
    - Viewed (0)
Back to top