Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for mapfndel (0.14 sec)

  1. 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)
  2. src/reflect/value.go

    }
    
    var stringType = rtypeOf("")
    
    // MapIndex returns the value associated with key in the map v.
    // It panics if v's Kind is not [Map].
    // It returns the zero Value if key is not found in the map or if v represents a nil map.
    // As in Go, the key's value must be assignable to the map's key type.
    func (v Value) MapIndex(key Value) Value {
    	v.mustBe(Map)
    	tt := (*mapType)(unsafe.Pointer(v.typ()))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 119.9K bytes
    - Viewed (0)
Back to top