Files
kustomize/vendor/github.com/modern-go/reflect2/test15/map_test.go
2018-05-11 14:07:15 -07:00

18 lines
303 B
Go

package test
import (
"testing"
"github.com/modern-go/reflect2"
)
func Test_map(t *testing.T) {
var pInt = func(val int) *int {
return &val
}
valType := reflect2.TypeOf(map[int]int{}).(reflect2.MapType)
m := map[int]int{}
valType.SetIndex(&m, pInt(1), pInt(1))
if m[1] != 1 {
t.Fail()
}
}