allocate icon indicating copy to clipboard operation
allocate copied to clipboard

Example code in readme is wrong

Open Kybxd opened this issue 3 years ago • 0 comments

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)
}

Kybxd avatar Sep 09 '22 07:09 Kybxd