On Sun, Aug 27, 2023 at 2:28 PM Antonio Caceres Cabrera
wrote:
>
> Thanks for your reply, Ian.
> I've decided on using a []*Foo now. Just to clarify, however: In general,
> copying/assigning from a struct literal as in
> a[i] = Foo{}, is that always safe for these sync types? Or generally, is
>
Thanks for your reply, Ian.
I've decided on using a []*Foo now. Just to clarify, however: In general,
copying/assigning from a struct literal as in
a[i] = Foo{}, is that always safe for these sync types? Or generally, is
copying their "untouched" zero-values always safe?
Antonio
On Sunday,
On Sun, Aug 27, 2023 at 7:54 AM Antonio Caceres Cabrera
wrote:
>
> Go vet complains about this minimal example code
>
> type Foo struct {
> val atomic.Uint64
> }
>
> func main() {
> var foos = make([]Foo, 0)
> var bar Foo
> bar.val.Store(5)
> foos = append(foos,