delve/_fixtures/issue1531.go
Alessandro Arzilli 2cadddd787 proc: Update map reading code for Go 1.12 (#1532)
Go 1.12 introduced a change to the internal map representation where
empty map cells can be marked with a tophash value of 1 instead of just
0.

Fixes #1531
2019-04-26 10:23:43 -07:00

38 lines
354 B
Go

package main
import (
"fmt"
"runtime"
)
type W struct {
x int
y int
}
func main() {
testMaps()
}
func testMaps() {
m := make(map[string]W)
m["t"] = W{}
m["s"] = W{}
m["r"] = W{}
m["v"] = W{}
mm := map[string]W{
"r": {},
"s": {},
"t": {},
"v": {},
}
delete(mm, "s")
delete(m, "t")
runtime.Breakpoint()
fmt.Println(m, mm)
}