Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 94 for NumField (0.35 sec)

  1. test/escape_reflect.go

    	v := reflect.ValueOf(x) // ERROR "x does not escape"
    	return v.Field(2).String()
    }
    
    func numfield(x S) int { // ERROR "x does not escape"
    	v := reflect.ValueOf(x) // ERROR "x does not escape"
    	return v.NumField()
    }
    
    func index1(x []int) int { // ERROR "x does not escape"
    	v := reflect.ValueOf(x) // ERROR "x does not escape"
    	return int(v.Index(0).Int())
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 18:50:24 UTC 2023
    - 13.1K bytes
    - Viewed (0)
  2. clause/expression.go

    				reflectValue = reflect.Indirect(reflectValue)
    				switch reflectValue.Kind() {
    				case reflect.Struct:
    					modelType := reflectValue.Type()
    					for i := 0; i < modelType.NumField(); i++ {
    						if fieldStruct := modelType.Field(i); ast.IsExported(fieldStruct.Name) {
    							namedMap[fieldStruct.Name] = reflectValue.Field(i).Interface()
    
    							if fieldStruct.Anonymous {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Oct 10 06:45:48 UTC 2023
    - 8.3K bytes
    - Viewed (0)
  3. operator/pkg/validate/validate.go

    	}
    
    	if util.IsNilOrInvalidValue(structElems) {
    		return
    	}
    
    	for i := 0; i < structElems.NumField(); i++ {
    		fieldName := structElems.Type().Field(i).Name
    		fieldValue := structElems.Field(i)
    		if !fieldValue.CanInterface() {
    			continue
    		}
    		kind := structElems.Type().Field(i).Type.Kind()
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jan 12 16:04:15 UTC 2023
    - 7.7K 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. staging/src/k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1/conversion_test.go

    	if a == b {
    		return
    	}
    
    	if a.Kind() != b.Kind() {
    		fatalTypeError(t, path, a, b, "mismatched Kind")
    	}
    
    	switch a.Kind() {
    	case reflect.Struct:
    		aFields := a.NumField()
    		bFields := b.NumField()
    		if aFields != bFields {
    			fatalTypeError(t, path, a, b, "mismatched field count")
    		}
    		for i := 0; i < aFields; i++ {
    			aField := a.Field(i)
    			bField := b.Field(i)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Feb 28 19:06:46 UTC 2024
    - 29.2K bytes
    - Viewed (0)
  6. 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)
  7. src/reflect/deepequal.go

    	case Pointer:
    		if v1.UnsafePointer() == v2.UnsafePointer() {
    			return true
    		}
    		return deepValueEqual(v1.Elem(), v2.Elem(), visited)
    	case Struct:
    		for i, n := 0, v1.NumField(); i < n; i++ {
    			if !deepValueEqual(v1.Field(i), v2.Field(i), visited) {
    				return false
    			}
    		}
    		return true
    	case Map:
    		if v1.IsNil() != v2.IsNil() {
    			return false
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:34:30 UTC 2024
    - 7.4K bytes
    - Viewed (0)
  8. pkg/api/testing/serialization_proto_test.go

    func fieldsHaveProtobufTags(obj reflect.Type) error {
    	switch obj.Kind() {
    	case reflect.Slice, reflect.Map, reflect.Pointer, reflect.Array:
    		return fieldsHaveProtobufTags(obj.Elem())
    	case reflect.Struct:
    		for i := 0; i < obj.NumField(); i++ {
    			f := obj.Field(i)
    			if f.Name == "TypeMeta" && f.Type.Name() == "TypeMeta" {
    				// TypeMeta is not included in external protobuf because we use an envelope type with TypeMeta
    				continue
    			}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jun 25 16:23:43 UTC 2022
    - 7.1K bytes
    - Viewed (0)
  9. staging/src/k8s.io/apimachinery/pkg/api/apitesting/roundtrip/construct.go

    		fill(dataString, dataInt, t.Elem(), item.Elem(), fillFuncs, filledTypes)
    		// store in the map
    		v.Set(reflect.MakeMap(t))
    		v.SetMapIndex(key, item.Elem())
    
    	case reflect.Struct:
    		for i := 0; i < t.NumField(); i++ {
    			field := t.Field(i)
    
    			if !field.IsExported() {
    				continue
    			}
    
    			// use the json field name, which must be stable
    			dataString := strings.Split(field.Tag.Get("json"), ",")[0]
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Feb 27 19:12:59 UTC 2023
    - 6.5K bytes
    - Viewed (0)
  10. src/encoding/asn1/asn1.go

    	case reflect.Struct:
    		structType := fieldType
    
    		for i := 0; i < structType.NumField(); i++ {
    			if !structType.Field(i).IsExported() {
    				err = StructuralError{"struct contains unexported fields"}
    				return
    			}
    		}
    
    		if structType.NumField() > 0 &&
    			structType.Field(0).Type == rawContentsType {
    			bytes := bytes[initOffset:offset]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 19:04:28 UTC 2023
    - 31.8K bytes
    - Viewed (0)
Back to top