Re: [go-nuts] Using structs, pointers, and maps

2024-10-09 Thread Ken Lee
hange one's already established opinion. On Wednesday 9 October 2024 at 5:56:03 pm UTC+8 Axel Wagner wrote: On Wed, 9 Oct 2024 at 09:54, Ken Lee wrote: So can I say that, if I'm not writing concurrency code, it's acceptable for me to mix pointer and value receiver? Note that you c

Re: [go-nuts] Is "When in doubt, use a pointer receiver" misleading advice?

2024-10-09 Thread Ken Lee
Hi Oliver is the link already available? Would like to learn more about this On Tuesday 14 November 2023 at 7:23:44 am UTC+8 Oliver Lowe wrote: > > I'd be curious to hear thoughts on this topic. > > There was a fun talk at GopherConAU just a few days ago: "What's > The Point? A Guide To Using Poin

Re: [go-nuts] Using structs, pointers, and maps

2024-10-09 Thread Ken Lee
>>>> Many places and books I've read generally say: If a function needs to >>>>> update a variable, or if an argument is so large that we want to avoid >>>>> copying it, we should pass the pointer. Same for methods (pointer >>>>> receiver

[go-nuts] Re: Using structs, pointers, and maps

2024-10-07 Thread Ken Lee
--- There is a consideration to make, though: historically it has been considered bad form in Go to give a type a mix of value and pointer receivers in methods without a very specific reason for doing so. --- Is this still the case now? As in 2024. On Sunday 13 January 2013 at 7:03:29 am UTC+8