modernc.org/gc@v1.0.1-0.20240304020402-f0dba7c97c2b/testdata/errchk/test/fixedbugs/issue4879.dir/a.go (about)

     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