allocate
allocate copied to clipboard
Example code in readme is wrong
func main() {
// topStruct is a pointer to TopLevelStruct
topStruct := new(TopLevelStruct)
fmt.Printf("before using allocate.Zero: %v\n", topStruct)
// try to allocate.Zero a pointer to pointer
// should be: allocate.Zero(topStruct)
allocate.Zero(&topStruct)
fmt.Printf("post allocate.Zero: %v\n", topStruct)
fmt.Printf("topStruct.MyEmbeddedStruct.SomeInt==%d\n", topStruct.MyEmbeddedStruct.SomeInt)
}