casting pointers in golang

Posted on Apr 12, 2024
  • You have a type eg. type Poop string, Say variable yeet is of type Poop
  • Now there’s a struct Yolo that has field doop which accepts *string
  • To assign yeet to doop, we do
      {
        ...
          doop: (*string)(&yeet)
      }