1 package a
2
3 import (
4 "unsafe"
5 )
6
7 type Collection struct {
8 root unsafe.Pointer
9 }
10
11 type nodeLoc struct{}
12
13 type slice []int
14
15 type maptype map[int]int
16
17 func MakePrivateCollection() *Collection {
18 return &Collection{
19 root: unsafe.Pointer(&nodeLoc{}),
20 }
21 }
22
23 func MakePrivateCollection2() *Collection {
24 return &Collection{
25 root: unsafe.Pointer(&slice{}),
26 }
27 }
28 func MakePrivateCollection3() *Collection {
29 return &Collection{
30 root: unsafe.Pointer(&maptype{}),
31 }
32 }
33
34
View as plain text