On Tue, Nov 16, 2021 at 3:33 PM Stephen Illingworth <
stephen.illingwo...@gmail.com> wrote:

> How about just a 'container' type for the interface.
>
> https://play.golang.org/p/WSXVjVHj1Ya
>

> For what I need, that does the job nicely. The type being stored in the
> atomic.Value isn't changing so it satisfies the atomic.Value constraints
> but I have the flexibility of the contained type being able to change. Any
> pitfalls with this?
>

No, that should work fine. Though I'm not sure about "just", it requires an
extra type but leads to exactly the same memory layout and everything. But
yeah, if you prefer that, it's completely fine.


>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/3f1d0c92-4ded-4096-95d9-069a9b5d78cen%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/3f1d0c92-4ded-4096-95d9-069a9b5d78cen%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAEkBMfHqyLBpeFDfrmvhMtHY2dk4u%3DvcSTFjZvSk75Xoz9wRWA%40mail.gmail.com.

Reply via email to