Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for SetMapIndex (0.26 sec)

  1. src/reflect/value.go

    		panic("reflect: slice capacity out of range in SetCap")
    	}
    	s.Cap = n
    }
    
    // SetMapIndex sets the element associated with key in the map v to elem.
    // It panics if v's Kind is not [Map].
    // If elem is the zero Value, SetMapIndex deletes the key from the map.
    // Otherwise if v holds a nil map, SetMapIndex will panic.
    // As in Go, key's elem must be assignable to the map's key type,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
  2. src/reflect/all_test.go

    		vv := mv.MapIndex(ValueOf(k))
    		if vi := vv.Int(); vi != int64(v) {
    			t.Errorf("Key %q: have value %d, want %d", k, vi, v)
    		}
    
    		// Copy into new map.
    		newmap.SetMapIndex(ValueOf(k), ValueOf(v))
    	}
    	vv := mv.MapIndex(ValueOf("not-present"))
    	if vv.IsValid() {
    		t.Errorf("Invalid key: got non-nil value %s", valueToString(vv))
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 218.8K bytes
    - Viewed (0)
  3. src/encoding/json/decode.go

    						break
    					}
    					kv = reflect.New(kt).Elem()
    					kv.SetUint(n)
    				default:
    					panic("json: Unexpected key type") // should never occur
    				}
    			}
    			if kv.IsValid() {
    				v.SetMapIndex(kv, subv)
    			}
    		}
    
    		// Next token must be , or }.
    		if d.opcode == scanSkipSpace {
    			d.scanWhile(scanSkipSpace)
    		}
    		if d.errorContext != nil {
    			// Reset errorContext to its original state.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 35.3K bytes
    - Viewed (0)
  4. pkg/apis/core/v1/defaults_test.go

    				// if we don't already have a value, and contain structs, add an empty item so we can recurse
    				item := reflect.New(visit.value.Type().Elem()).Elem()
    				visit.value.Set(reflect.MakeMap(visit.value.Type()))
    				visit.value.SetMapIndex(reflect.New(visit.value.Type().Key()).Elem(), item)
    				toVisit = append(toVisit, testPath{path: visit.path + "[*]", value: item})
    			} else if !isPrimitive(visit.value.Type().Elem().Kind()) {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 84.4K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"(Value).SetFloat", Method, 0},
    		{"(Value).SetInt", Method, 0},
    		{"(Value).SetIterKey", Method, 18},
    		{"(Value).SetIterValue", Method, 18},
    		{"(Value).SetLen", Method, 0},
    		{"(Value).SetMapIndex", Method, 0},
    		{"(Value).SetPointer", Method, 0},
    		{"(Value).SetString", Method, 0},
    		{"(Value).SetUint", Method, 0},
    		{"(Value).SetZero", Method, 20},
    		{"(Value).Slice", Method, 0},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
Back to top