Circular references in structs in Go can lead to _______.

  • Compilation errors
  • Garbage collection
  • Memory leaks
  • Runtime panics
Circular references in structs occur when a field within a struct refers back to the struct itself directly or indirectly. This can lead to memory leaks, where memory is allocated but never released because the circular references prevent the garbage collector from identifying unused memory.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *