Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 94 for NumField (0.13 sec)

  1. src/go/internal/gccgoimporter/testdata/v1reflect.gox

    <type 34 [] <type -11>>) <type 30>; FieldByName (name <type -16>) (? <type 30>, ? <type -15>); FieldByNameFunc (match <type 35 (? <type -16>) <type -15>>) (? <type 30>, ? <type -15>); In (i <type -11>) <type 26>; Key () <type 26>; Len () <type -11>; NumField () <type -11>; NumIn () <type -11>; NumOut () <type -11>; Out (i <type -11>) <type 26>; .reflect.runtimeType () <type 36 *<type 22>>; .reflect.common () <type 37 *<type 4>>; .reflect.uncommon () <type 38 *<type 12>>; }>>; Func <type 1>; Index <type...
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 30 21:33:51 UTC 2021
    - 10.3K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/convert_test.go

    	f.MaxDepth(2)
    	f.NilChance(0.5)
    
    	for i := 0; i < 10000; i++ {
    		// fuzz a random field in JSONSchemaProps
    		origSchema := &apiextensions.JSONSchemaProps{}
    		x := reflect.ValueOf(origSchema).Elem()
    		n := rand.Intn(x.NumField())
    		if name := x.Type().Field(n).Name; name == "Example" || name == "ExternalDocs" {
    			// we drop these intentionally
    			continue
    		}
    		f.Fuzz(x.Field(n).Addr().Interface())
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Sep 23 02:09:41 UTC 2022
    - 2.9K bytes
    - Viewed (0)
  3. src/reflect/benchmark_test.go

    		ArrayStruct4Int_1024 [256]Int4
    		ArrayChanInt_1024    [1024]chan int
    		StructInt_512        Int512
    	}{}
    	s.ArrayInt_1024_NoZero[512] = 1
    	source := ValueOf(s)
    
    	for i := 0; i < source.NumField(); i++ {
    		name := source.Type().Field(i).Name
    		value := source.Field(i)
    		b.Run(name, func(b *testing.B) {
    			for i := 0; i < b.N; i++ {
    				sink = value.IsZero()
    			}
    		})
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Nov 19 17:09:03 UTC 2023
    - 8.8K bytes
    - Viewed (0)
  4. src/encoding/xml/typeinfo.go

    func getTypeInfo(typ reflect.Type) (*typeInfo, error) {
    	if ti, ok := tinfoMap.Load(typ); ok {
    		return ti.(*typeInfo), nil
    	}
    
    	tinfo := &typeInfo{}
    	if typ.Kind() == reflect.Struct && typ != nameType {
    		n := typ.NumField()
    		for i := 0; i < n; i++ {
    			f := typ.Field(i)
    			if (!f.IsExported() && !f.Anonymous) || f.Tag.Get("xml") == "-" {
    				continue // Private field
    			}
    
    			// For embedded structs, embed its fields.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 00:23:29 UTC 2023
    - 9.6K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/conversion/queryparams/convert.go

    	}
    
    	// Check all object fields
    	convertStruct(result, st, sv)
    
    	return result, nil
    }
    
    func convertStruct(result url.Values, st reflect.Type, sv reflect.Value) {
    	for i := 0; i < st.NumField(); i++ {
    		field := sv.Field(i)
    		tag, omitempty := jsonTag(st.Field(i))
    		if len(tag) == 0 {
    			continue
    		}
    		ft := field.Type()
    
    		kind := ft.Kind()
    		if isPointerKind(kind) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sat Jun 25 16:23:43 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  6. src/reflect/badlinkname.go

    //go:linkname badlinkname_rtype_Name reflect.(*rtype).Name
    func badlinkname_rtype_Name(*rtype) string
    
    //go:linkname badlinkname_rtype_NumField reflect.(*rtype).NumField
    func badlinkname_rtype_NumField(*rtype) int
    
    //go:linkname badlinkname_rtype_NumIn reflect.(*rtype).NumIn
    func badlinkname_rtype_NumIn(*rtype) int
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/syntax/dumper.go

    			// if c := *n.Comments(); c != nil {
    			// 	p.printf("Comments: ")
    			// 	p.dump(reflect.ValueOf(c), nil) // a Comment is not a Node
    			// 	p.printf("\n")
    			// }
    		}
    
    		for i, n := 0, typ.NumField(); i < n; i++ {
    			// Exclude non-exported fields because their
    			// values cannot be accessed via reflection.
    			if name := typ.Field(i).Name; isExported(name) {
    				if first {
    					p.printf("\n")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jan 08 17:32:14 UTC 2021
    - 4.5K bytes
    - Viewed (0)
  8. src/reflect/example_test.go

    	// blue gopher
    }
    
    func ExampleStructTag_Lookup() {
    	type S struct {
    		F0 string `alias:"field_0"`
    		F1 string `alias:""`
    		F2 string
    	}
    
    	s := S{}
    	st := reflect.TypeOf(s)
    	for i := 0; i < st.NumField(); i++ {
    		field := st.Field(i)
    		if alias, ok := field.Tag.Lookup("alias"); ok {
    			if alias == "" {
    				fmt.Println("(blank)")
    			} else {
    				fmt.Println(alias)
    			}
    		} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 19 20:04:36 UTC 2022
    - 4.5K bytes
    - Viewed (0)
  9. src/cmd/fix/cftype.go

    			if v.Type().Kind() != reflect.Pointer {
    				return
    			}
    			if v.IsNil() {
    				return
    			}
    			v = v.Elem()
    			if v.Type().Kind() != reflect.Struct {
    				return
    			}
    			for i := 0; i < v.NumField(); i++ {
    				f := v.Field(i)
    				if f.Type() == exprType {
    					if r := badNils[f.Interface()]; r != nil {
    						f.Set(reflect.ValueOf(r))
    						changed = true
    					}
    				}
    				if f.Type() == exprSliceType {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 00:25:49 UTC 2023
    - 3.5K bytes
    - Viewed (0)
  10. src/internal/fmtsort/sort.go

    	case reflect.Chan:
    		if c, ok := nilCompare(aVal, bVal); ok {
    			return c
    		}
    		return cmp.Compare(aVal.Pointer(), bVal.Pointer())
    	case reflect.Struct:
    		for i := 0; i < aVal.NumField(); i++ {
    			if c := compare(aVal.Field(i), bVal.Field(i)); c != 0 {
    				return c
    			}
    		}
    		return 0
    	case reflect.Array:
    		for i := 0; i < aVal.Len(); i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 19:31:45 UTC 2024
    - 4.9K bytes
    - Viewed (0)
Back to top