mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
Composite literals using the &T{} form were incorrectly
exported, leading to weird errors at import time.
Fixes #4879.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7395054
33 lines
466 B
Go
33 lines
466 B
Go
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{}),
|
|
}
|
|
}
|
|
|