/
githubmirror
/
go
Обзор
Документация
Войти
/
githubmirror
/
go
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/fixedbugs/issue4879.dir/a.go
32 строки
466 B
Rémy Oudompheng
cmd/gc: fix corruption in export of &T{} literals.
26 фев 2013, 03:43
26 фев 2013, 03:43
9e66ee4
Код
Авторство
О чём код?
package a import ( "unsafe" ) type Collection struct { root unsafe.Pointer } type nodeLoc struct{} type slice []int type maptype map[int]int func MakePrivateCollection() *Collection { return &Collection{ root: unsafe.Pointer(&nodeLoc{}), } } func MakePrivateCollection2() *Collection { return &Collection{ root: unsafe.Pointer(&slice{}), } } func MakePrivateCollection3() *Collection { return &Collection{ root: unsafe.Pointer(&maptype{}), } }