Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 35 for NumField (0.21 sec)

  1. 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)
  2. 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)
  3. 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)
  4. src/cmd/vendor/github.com/google/pprof/internal/driver/config.go

    		"noinlines":            "noinlines",
    		"showcolumns":          "showcolumns",
    	}
    
    	def := defaultConfig()
    	configFieldMap = map[string]configField{}
    	t := reflect.TypeOf(config{})
    	for i, n := 0, t.NumField(); i < n; i++ {
    		field := t.Field(i)
    		js := strings.Split(field.Tag.Get("json"), ",")
    		if len(js) == 0 {
    			continue
    		}
    		// Get the configuration name for this field.
    		name := js[0]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 16 15:19:53 UTC 2024
    - 10.5K bytes
    - Viewed (0)
  5. src/testing/quick/quick.go

    		codePoints := make([]rune, numChars)
    		for i := 0; i < numChars; i++ {
    			codePoints[i] = rune(rand.Intn(0x10ffff))
    		}
    		v.SetString(string(codePoints))
    	case reflect.Struct:
    		n := v.NumField()
    		// Divide sizeLeft evenly among the struct fields.
    		sizeLeft := size
    		if n > sizeLeft {
    			sizeLeft = 1
    		} else if n > 0 {
    			sizeLeft /= n
    		}
    		for i := 0; i < n; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 08 17:55:47 UTC 2023
    - 10.1K bytes
    - Viewed (0)
  6. pkg/api/v1/persistentvolume/util_test.go

    	case reflect.Struct:
    		// ObjectMeta should not have any field with the word "secret" in it;
    		// 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)
    			secretPaths.Insert(sets.List[string](collectSecretPaths(t, 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
    - 14.5K 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/malloc_test.go

    		"NumGC": {nz, le(1e9)}, "NumForcedGC": {nz, le(1e9)},
    		"GCCPUFraction": {le(0.99)}, "EnableGC": {eq(true)}, "DebugGC": {eq(false)},
    		"BySize": nil,
    	}
    
    	rst := reflect.ValueOf(st).Elem()
    	for i := 0; i < rst.Type().NumField(); i++ {
    		name, val := rst.Type().Field(i).Name, rst.Field(i).Interface()
    		checks, ok := fields[name]
    		if !ok {
    			t.Errorf("unknown MemStats field %s", name)
    			continue
    		}
    		for _, check := range checks {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 05 23:35:29 UTC 2023
    - 10.6K bytes
    - Viewed (0)
  10. pkg/util/iptables/testing/parse.go

    // returns a pointer to the Value of that field, and the value of its "negatable" tag.
    func findParamField(value reflect.Value, param string) (*reflect.Value, bool) {
    	typ := value.Type()
    	for i := 0; i < typ.NumField(); i++ {
    		field := typ.Field(i)
    		if field.Tag.Get("param") == param {
    			fValue := value.Field(i)
    			return &fValue, field.Tag.Get("negatable") == "true"
    		}
    	}
    	return nil, false
    }
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Dec 19 01:20:51 UTC 2023
    - 11.6K bytes
    - Viewed (0)
Back to top