Silent observation shouldn't affect the observed. Sometimes, however, you can' avoid to affect the object you observe. For example, to track a data structure across its lifetime, you'd need to hold a pointer to it. But an active pointer to an object prevents it from getting garbage collected.
A catch-22?
Say hello to weak pointers. More on this in the Spotlight section of the latest Applied Go Weekly Newsletter issue.
https://newsletter.appliedgo.net/archive/2025-01-26-a-weak-connection-is-still-a-connection/?utm_source=appliedgo-mastodon
[#]golang
=> More informations about this toot | View the thread | More toots from christophberger@c.im
=> View golang tag This content has been proxied by September (3851b).Proxy Information
text/gemini