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
funcfalse_positive() {
outer:=make(map[string]map[string]int)
inner:= []string{"a"}
if_, ok:=outer[inner[0]]; !ok {
outer[inner[0]] =map[string]int{}
}
outer[inner[0]]["value"] =1
}
// error: Potential nil panic detected. Observed nil flow from source to dereference point:// - deep read from local variable `outer` lacking guarding; written to at an index// When the expression is assigned to a variable, it succeedsfunctrue_negative() {
outer:=make(map[string]map[string]int)
inner:= []string{"a"}
x:=inner[0]
if_, ok:=outer[x]; !ok {
outer[x] =map[string]int{}
}
outer[x]["value"] =1
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: