You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import "reflect"
func main() {
var m map[int]int
delete(m, 5)
v := reflect.ValueOf(m)
v.SetMapIndex(reflect.ValueOf(5), reflect.Value{})
}
The first two lines succeed with no panic, as they should.
The second two lines panic with "delete from nil map".
They should silently succeed instead, like the non-reflect version.
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: