News for hackers. Stuff that matters.
Re:Idiomatic Go (2016) by tczMUFlmoNk on Sunday March 09, 2025 @06:34PM (#43314614)
> > Avoid unused method receiver names

> That's just "don't create a non-static method if you don't use 'this'" in other languages with classes.

I don't think that's what's meant. It means to write `func (Receiver) Method()` rather than `func (r Receiver) Method()` when you don't use `r`. Sometimes you need this to implement an interface like `error` or `Stringer` and you just don't need instance data.

(I'm no Go apologist but I think "receiver" is a great term. It's clear, it's applies to other languages and paradigms, and it doesn't really have an alternative that I'm aware of.)

Re:Idiomatic Go (2016) by layer8 on Sunday March 09, 2025 @06:50PM (#43314749)
The term “receiver” comes from Smalltalk: http://www.bitsavers.org/pdf/xerox/parc/techReports/SSL-76-6...
Re:Idiomatic Go (2016) by tczMUFlmoNk on Sunday March 09, 2025 @07:22PM (#43314987)
That makes sense. I just about figured it would. :-)