Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 79 for NumField (0.15 sec)

  1. src/net/http/h2_error.go

    		return false
    	}
    	src := reflect.ValueOf(e)
    	srcType := src.Type()
    	numField := srcType.NumField()
    	if dstType.NumField() != numField {
    		return false
    	}
    	for i := 0; i < numField; i++ {
    		sf := srcType.Field(i)
    		df := dstType.Field(i)
    		if sf.Name != df.Name || !sf.Type.ConvertibleTo(df.Type) {
    			return false
    		}
    	}
    	for i := 0; i < numField; i++ {
    		df := dst.Field(i)
    		df.Set(src.Field(i).Convert(df.Type()))
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:27 UTC 2023
    - 812 bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiserver/pkg/authorization/cel/compile_test.go

    	if len(requestDeclType.Fields) != requestType.NumField() {
    		t.Fatalf("expected %d fields for SubjectAccessReviewSpec, got %d", requestType.NumField(), len(requestDeclType.Fields))
    	}
    	resourceAttributesDeclType := buildResourceAttributesType(f, fs)
    	resourceAttributeType := reflect.TypeOf(v1.ResourceAttributes{})
    	if len(resourceAttributesDeclType.Fields) != resourceAttributeType.NumField() {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  3. utils/tests/utils.go

    				return
    			}
    		}
    
    		if reflect.ValueOf(got).Kind() == reflect.Struct {
    			if reflect.ValueOf(expect).Kind() == reflect.Struct {
    				if reflect.ValueOf(got).NumField() == reflect.ValueOf(expect).NumField() {
    					exported := false
    					for i := 0; i < reflect.ValueOf(got).NumField(); i++ {
    						if fieldStruct := reflect.ValueOf(got).Type().Field(i); ast.IsExported(fieldStruct.Name) {
    							exported = true
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Mar 10 09:21:56 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apiserver/pkg/authentication/cel/compile_test.go

    	userDeclType := buildUserType()
    	userType := reflect.TypeOf(authenticationv1.UserInfo{})
    
    	if len(userDeclType.Fields) != userType.NumField() {
    		t.Errorf("expected %d fields, got %d", userType.NumField(), len(userDeclType.Fields))
    	}
    
    	for i := 0; i < userType.NumField(); i++ {
    		field := userType.Field(i)
    		jsonTagParts := strings.Split(field.Tag.Get("json"), ",")
    		if len(jsonTagParts) < 1 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 10 22:07:40 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  5. staging/src/k8s.io/api/networking/v1/types_test.go

    // protobuf field numbers are not accidentally reused by other fields.
    func Test_NetworkPolicyRemovedFieldProtobufNumberReservation(t *testing.T) {
    	obj := reflect.ValueOf(NetworkPolicy{}).Type()
    	for i := 0; i < obj.NumField(); i++ {
    		f := obj.Field(i)
    		protobufSpec := f.Tag.Get("protobuf")
    		if protobufSpec == "" {
    			continue
    		}
    
    		protobufNum := strings.Split(protobufSpec, ",")[1]
    		if protobufNum == "3" {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 01 18:19:25 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/validation_test.go

    		}
    	}
    
    	// check that anything other than name and generateName of ObjectMeta in metadata properties is forbidden
    	tt := reflect.TypeOf(metav1.ObjectMeta{})
    	for i := 0; i < tt.NumField(); i++ {
    		property := tt.Field(i).Name
    		s := &Structural{
    			Generic: Generic{
    				Type: "object",
    			},
    			Properties: map[string]Structural{
    				property: {},
    			},
    		}
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 31 18:20:00 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  7. src/internal/buildcfg/exp.go

    	// and overridden at build time.
    	if goexp != "" {
    		// Create a map of known experiment names.
    		names := make(map[string]func(bool))
    		rv := reflect.ValueOf(&flags.Flags).Elem()
    		rt := rv.Type()
    		for i := 0; i < rt.NumField(); i++ {
    			field := rv.Field(i)
    			names[strings.ToLower(rt.Field(i).Name)] = field.SetBool
    		}
    
    		// "regabi" is an alias for all working regabi
    		// subexperiments, and not an experiment itself. Doing
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 17:38:52 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  8. src/runtime/time_test.go

    	// (meaning those two must have the same layout).
    	runtimeTimeTimer := reflect.TypeOf(runtime.TimeTimer{})
    
    	check := func(name string, typ reflect.Type) {
    		n1 := runtimeTimeTimer.NumField()
    		n2 := typ.NumField()
    		if n1 != n2+1 {
    			t.Errorf("runtime.TimeTimer has %d fields, want %d (%s has %d fields)", n1, n2+1, name, n2)
    			return
    		}
    		for i := 0; i < n2; i++ {
    			f1 := runtimeTimeTimer.Field(i)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Mar 09 03:40:04 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  9. staging/src/k8s.io/api/extensions/v1beta1/types_test.go

    // protobuf field numbers are not accidentally reused by other fields.
    func Test_NetworkPolicyRemovedFieldProtobufNumberReservation(t *testing.T) {
    	obj := reflect.ValueOf(NetworkPolicy{}).Type()
    	for i := 0; i < obj.NumField(); i++ {
    		f := obj.Field(i)
    		protobufSpec := f.Tag.Get("protobuf")
    		if protobufSpec == "" {
    			continue
    		}
    
    		protobufNum := strings.Split(protobufSpec, ",")[1]
    		if protobufNum == "3" {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon May 01 18:19:25 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apimachinery/pkg/api/apitesting/naming/naming.go

    		// no-op
    
    	case reflect.Struct:
    		for i := 0; i < tp.NumField(); i++ {
    			f := tp.Field(i)
    			if f.PkgPath != "" {
    				continue // Ignore unexported fields
    			}
    			jsonTag := f.Tag.Get("json")
    			protoTag := f.Tag.Get("protobuf")
    			if len(jsonTag) > 0 || len(protoTag) > 0 {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jul 27 07:07:03 UTC 2022
    - 5.8K bytes
    - Viewed (0)
Back to top