Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for NumField (0.14 sec)

  1. 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)
  2. src/encoding/gob/encode.go

    		for fieldNum, wireFieldNum := 0, 0; fieldNum < srt.NumField(); fieldNum++ {
    			f := srt.Field(fieldNum)
    			if !isSent(&f) {
    				continue
    			}
    			op, indir := encOpFor(f.Type, seen, building)
    			engine.instr = append(engine.instr, encInstr{*op, wireFieldNum, f.Index, indir})
    			wireFieldNum++
    		}
    		if srt.NumField() > 0 && len(engine.instr) == 0 {
    			errorf("type %s has no exported fields", rt)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 02:00:26 UTC 2024
    - 19K bytes
    - Viewed (0)
  3. src/encoding/binary/binary.go

    func sizeof(t reflect.Type) int {
    	switch t.Kind() {
    	case reflect.Array:
    		if s := sizeof(t.Elem()); s >= 0 {
    			return s * t.Len()
    		}
    
    	case reflect.Struct:
    		sum := 0
    		for i, n := 0, t.NumField(); i < n; i++ {
    			s := sizeof(t.Field(i).Type)
    			if s < 0 {
    				return -1
    			}
    			sum += s
    		}
    		return sum
    
    	case reflect.Bool,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 17:29:31 UTC 2024
    - 23.4K bytes
    - Viewed (0)
  4. pkg/kubelet/apis/config/helpers_test.go

    	}
    
    	paths := sets.New[string]()
    	switch tp.Kind() {
    	case reflect.Pointer:
    		paths.Insert(sets.List(allPrimitiveFieldPaths(t, skipRecurseList, tp.Elem(), path))...)
    	case reflect.Struct:
    		for i := 0; i < tp.NumField(); i++ {
    			field := tp.Field(i)
    			paths.Insert(sets.List(allPrimitiveFieldPaths(t, skipRecurseList, field.Type, path.Child(field.Name)))...)
    		}
    	case reflect.Map, reflect.Slice:
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 04 06:25:43 UTC 2024
    - 10.2K bytes
    - Viewed (0)
  5. src/internal/reflectlite/type.go

    func (t rtype) Len() int {
    	tt := t.Type.ArrayType()
    	if tt == nil {
    		panic("reflect: Len of non-array type")
    	}
    	return int(tt.Len)
    }
    
    func (t rtype) NumField() int {
    	tt := t.Type.StructType()
    	if tt == nil {
    		panic("reflect: NumField of non-struct type")
    	}
    	return len(tt.Fields)
    }
    
    func (t rtype) NumIn() int {
    	tt := t.Type.FuncType()
    	if tt == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 07 17:01:54 UTC 2024
    - 16.2K bytes
    - Viewed (0)
  6. src/encoding/asn1/marshal.go

    		return int64Encoder(v.Int()), nil
    	case reflect.Struct:
    		t := v.Type()
    
    		for i := 0; i < t.NumField(); i++ {
    			if !t.Field(i).IsExported() {
    				return nil, StructuralError{"struct contains unexported fields"}
    			}
    		}
    
    		startingField := 0
    
    		n := t.NumField()
    		if n == 0 {
    			return bytesEncoder(nil), nil
    		}
    
    		// If the first element of the structure is a non-empty
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 17.1K bytes
    - Viewed (0)
  7. schema/schema.go

    	if v, ok := cacheStore.Load(schemaCacheKey); ok {
    		s := v.(*Schema)
    		// Wait for the initialization of other goroutines to complete
    		<-s.initialized
    		return s, s.err
    	}
    
    	for i := 0; i < modelType.NumField(); i++ {
    		if fieldStruct := modelType.Field(i); ast.IsExported(fieldStruct.Name) {
    			if field := schema.ParseField(fieldStruct); field.EmbeddedSchema != nil {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:52:33 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  8. 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)
  9. 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)
  10. 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)
Back to top