Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 79 for NumField (0.17 sec)

  1. operator/pkg/apis/istio/v1alpha1/validation/validation.go

    		}
    	}
    	// If it is not a struct nothing to do, returning previously collected validation errors
    	if e.Kind() != reflect.Struct {
    		return validationErrors
    	}
    	for i := 0; i < e.NumField(); i++ {
    		// Corner case of a slice of something, if something is defined type, then process it recursively.
    		if e.Field(i).Kind() == reflect.Slice {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 16 20:02:28 UTC 2024
    - 14.9K bytes
    - Viewed (0)
  2. schema/field.go

    					for i := 0; i < rvType.NumField(); i++ {
    						for key, value := range ParseTagSetting(rvType.Field(i).Tag.Get("gorm"), ";") {
    							if _, ok := field.TagSettings[key]; !ok {
    								field.TagSettings[key] = value
    							}
    						}
    					}
    
    					for i := 0; i < rvType.NumField(); i++ {
    						newFieldType := rvType.Field(i).Type
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Apr 15 03:20:20 UTC 2024
    - 32K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/ir/fmt.go

    		fmt.Fprintf(w, " %+v", n.Sym())
    	}
    
    	// Print Node-specific fields of basic type in header line.
    	v := reflect.ValueOf(n).Elem()
    	t := v.Type()
    	nf := t.NumField()
    	for i := 0; i < nf; i++ {
    		tf := t.Field(i)
    		if tf.PkgPath != "" {
    			// skip unexported field - Interface will fail
    			continue
    		}
    		k := tf.Type.Kind()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 26K bytes
    - Viewed (0)
  4. pkg/apis/core/fuzzer/fuzzer.go

    				*k.Mode &= 0777
    			}
    		},
    		func(vs *core.VolumeSource, c fuzz.Continue) {
    			// Exactly one of the fields must be set.
    			v := reflect.ValueOf(vs).Elem()
    			i := int(c.RandUint64() % uint64(v.NumField()))
    			t := v.Field(i).Addr()
    			for v.Field(i).IsNil() {
    				c.Fuzz(t.Interface())
    			}
    		},
    		func(i *core.ISCSIVolumeSource, c fuzz.Continue) {
    			i.ISCSIInterface = c.RandString()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 26 04:32:01 UTC 2024
    - 18.5K bytes
    - Viewed (0)
  5. src/runtime/gc_test.go

    			return
    		}
    		for i := 0; i < got.Len(); i++ {
    			logDiff(t, fmt.Sprintf("%s[%d]", prefix, i), got.Index(i), want.Index(i))
    		}
    	case reflect.Struct:
    		for i := 0; i < typ.NumField(); i++ {
    			gf, wf := got.Field(i), want.Field(i)
    			logDiff(t, prefix+"."+typ.Field(i).Name, gf, wf)
    		}
    	case reflect.Map:
    		t.Fatal("not implemented: logDiff for map")
    	default:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 05 22:33:52 UTC 2024
    - 17.6K bytes
    - Viewed (0)
  6. pkg/scheduler/eventhandlers_test.go

    			}
    		})
    	}
    }
    
    func TestNodeConditionsChanged(t *testing.T) {
    	nodeConditionType := reflect.TypeOf(v1.NodeCondition{})
    	if nodeConditionType.NumField() != 6 {
    		t.Errorf("NodeCondition type has changed. The nodeConditionsChanged() function must be reevaluated.")
    	}
    
    	for _, test := range []struct {
    		Name          string
    		Changed       bool
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 10 14:38:54 UTC 2024
    - 21.5K bytes
    - Viewed (0)
  7. 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)
  8. pkg/api/v1/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: Mon Sep 25 11:04:08 UTC 2023
    - 32.1K bytes
    - Viewed (0)
  9. src/encoding/binary/binary_test.go

    			ts := T{}
    			if _, err := enc.fn(BigEndian, ts); err == nil {
    				t.Errorf("WriteT: have err == nil, want non-nil")
    			}
    
    			tv := reflect.Indirect(reflect.ValueOf(ts))
    			for i, n := 0, tv.NumField(); i < n; i++ {
    				typ := tv.Field(i).Type().String()
    				if typ == "[4]int" {
    					typ = "int" // the problem is int, not the [4]
    				}
    				if _, err := enc.fn(BigEndian, tv.Field(i).Interface()); err == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 19:16:18 UTC 2024
    - 25.4K bytes
    - Viewed (0)
  10. src/net/http/response_test.go

    	t.Helper()
    	hv := reflect.ValueOf(have).Elem()
    	wv := reflect.ValueOf(want).Elem()
    	if hv.Type() != wv.Type() {
    		t.Errorf("%s: type mismatch %v want %v", prefix, hv.Type(), wv.Type())
    	}
    	for i := 0; i < hv.NumField(); i++ {
    		name := hv.Type().Field(i).Name
    		if !token.IsExported(name) {
    			continue
    		}
    		hf := hv.Field(i).Interface()
    		wf := wv.Field(i).Interface()
    		if !reflect.DeepEqual(hf, wf) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 19:01:29 UTC 2024
    - 23.6K bytes
    - Viewed (0)
Back to top