Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 38 for mapfndel (0.25 sec)

  1. src/go/ast/print.go

    	case reflect.Map:
    		p.printf("%s (len = %d) {", x.Type(), x.Len())
    		if x.Len() > 0 {
    			p.indent++
    			p.printf("\n")
    			for _, key := range x.MapKeys() {
    				p.print(key)
    				p.printf(": ")
    				p.print(x.MapIndex(key))
    				p.printf("\n")
    			}
    			p.indent--
    		}
    		p.printf("}")
    
    	case reflect.Pointer:
    		p.printf("*")
    		// type-checked ASTs may contain cycles - use ptrmap
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Mar 28 21:32:41 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  2. staging/src/k8s.io/apimachinery/pkg/runtime/converter.go

    	}
    
    	if sv.IsNil() {
    		dv.Set(reflect.Zero(dt))
    		return nil
    	}
    	dv.Set(reflect.MakeMap(dt))
    	for _, key := range sv.MapKeys() {
    		value := reflect.New(dt.Elem()).Elem()
    		if val := unwrapInterface(sv.MapIndex(key)); val.IsValid() {
    			if err := fromUnstructured(val, value, ctx); err != nil {
    				return err
    			}
    		} else {
    			value.Set(reflect.Zero(dt.Elem()))
    		}
    		if st.Key().AssignableTo(dt.Key()) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jul 11 16:02:13 UTC 2023
    - 24.9K bytes
    - Viewed (0)
  3. test/escape_reflect.go

    	return v.NumMethod()
    }
    
    // Unfortunate: k doesn't need to escape.
    func mapindex(m map[string]string, k string) string { // ERROR "m does not escape" "leaking param: k$"
    	mv := reflect.ValueOf(m)
    	kv := reflect.ValueOf(k) // ERROR "k escapes to heap"
    	return mv.MapIndex(kv).String()
    }
    
    func mapkeys(m map[string]string) []reflect.Value { // ERROR "m does not escape"
    	mv := reflect.ValueOf(m)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 08 18:50:24 UTC 2023
    - 13.1K bytes
    - Viewed (0)
  4. operator/pkg/validate/validate.go

    			for _, key := range fieldValue.MapKeys() {
    				nnp := append(newPath, key.String())
    				errs = util.AppendErrs(errs, validateLeaf(validations, nnp, fieldValue.MapIndex(key), checkRequired))
    			}
    		case reflect.Slice:
    			for i := 0; i < fieldValue.Len(); i++ {
    				newValue := fieldValue.Index(i).Interface()
    				newPath := append(path, indexPathForSlice(fieldName, i))
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jan 12 16:04:15 UTC 2023
    - 7.7K bytes
    - Viewed (0)
  5. operator/pkg/apis/istio/v1alpha1/validation/validation.go

    }
    
    func processMap(e reflect.Value, failOnMissingValidation bool, values *valuesv1alpha1.Values, iopls *v1alpha1.IstioOperatorSpec) util.Errors {
    	var validationErrors util.Errors
    	for _, k := range e.MapKeys() {
    		v := e.MapIndex(k)
    		validationErrors = append(validationErrors, ValidateSubTypes(v, failOnMissingValidation, values, iopls)...)
    	}
    
    	return validationErrors
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu May 16 20:02:28 UTC 2024
    - 14.9K bytes
    - Viewed (0)
  6. src/go/types/example_test.go

    	case tv.IsType():
    		return "type"
    	case tv.IsBuiltin():
    		return "builtin"
    	case tv.IsNil():
    		return "nil"
    	case tv.Assignable():
    		if tv.Addressable() {
    			return "var"
    		}
    		return "mapindex"
    	case tv.IsValue():
    		return "value"
    	default:
    		return "unknown"
    	}
    }
    
    func exprString(fset *token.FileSet, expr ast.Expr) string {
    	var buf strings.Builder
    	format.Node(&buf, fset, expr)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 8.9K bytes
    - Viewed (0)
  7. src/go/internal/gccgoimporter/testdata/v1reflect.gox

     func (v <type 1>) IsNil () <type -15>;
     func (v <type 1>) IsValid () <type -15>;
     func (v <type 1>) Kind () <type 28>;
     func (v <type 1>) Len () <type -11>;
     func (v <type 1>) MapIndex (key <type 1>) <type 1>;
     func (v <type 1>) MapKeys () <type 55 [] <type 1>>;
     func (v <type 1>) Method (i <type -11>) <type 1>;
     func (v <type 1>) NumMethod () <type -11>;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 30 21:33:51 UTC 2021
    - 10.3K bytes
    - Viewed (0)
  8. operator/pkg/compare/compare.go

    				return true
    			}
    		}
    		return false
    	}, cmp.Ignore())
    }
    
    func pathToStringList(path cmp.Path) (up []string) {
    	for _, step := range path {
    		switch t := step.(type) {
    		case cmp.MapIndex:
    			up = append(up, fmt.Sprintf("%v", t.Key()))
    		case cmp.SliceIndex:
    			// Create an element, but never an NPath
    			s := t.String()
    			if util.IsNPathElement(s) {
    				// Convert e.g. [0] to [#0]
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Apr 15 01:29:35 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  9. src/reflect/all_test.go

    	}
    
    	// Check that value for missing key is zero.
    	x := mv.MapIndex(ValueOf("hello"))
    	if x.Kind() != Invalid {
    		t.Errorf("m.MapIndex(\"hello\") for nil map = %v, want Invalid Value", x)
    	}
    
    	// Check big value too.
    	var mbig map[string][10 << 20]byte
    	x = ValueOf(mbig).MapIndex(ValueOf("hello"))
    	if x.Kind() != Invalid {
    		t.Errorf("mbig.MapIndex(\"hello\") for nil map = %v, want Invalid Value", x)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
  10. src/text/template/funcs.go

    			}
    			item = item.Index(x)
    		case reflect.Map:
    			index, err := prepareArg(index, item.Type().Key())
    			if err != nil {
    				return reflect.Value{}, err
    			}
    			if x := item.MapIndex(index); x.IsValid() {
    				item = x
    			} else {
    				item = reflect.Zero(item.Type().Elem())
    			}
    		case reflect.Invalid:
    			// the loop holds invariant: item.IsValid()
    			panic("unreachable")
    		default:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 24 22:23:55 UTC 2024
    - 20.9K bytes
    - Viewed (0)
Back to top