On Tuesday, 14 November 2023 at 03:38:04 UTC Mike Schinkel wrote:

1. A value variable and multiple value receivers  <--- compiles
2. A pointer variable and multiple value receivers <--- compiles
3. A pointer variable and multiple pointer receivers.  <--- compiles 
4. A value variable and multiple pointer receivers.  <--- will NOT compile
5. A pointer variable and mixed value+pointer receivers  <--- compiles 
6. A value variable and mixed value+pointer receivers. <--- will NOT compile

Permutation #4 and #6 are consistent with the description above, and they 
both have *a value variable *in common.

However, given than #5 DOES compile, I was left wondering why the standard 
that mixed receivers should be flagged as an error? 


I am not sure that "the standard" is for mixed receivers to be flagged as 
an error. Can you give a specific example of where the standard Go 
toolchain does this?

Is this question really about Goland, a third-party product, and/or some 
underlying third-party linter that it uses?  If so, it's an issue for that 
third party.

Arguably it's not great style to do this, and it might make it confusing 
for users of your package. But it's not an error, either for the compiler 
or "go vet". https://go.dev/play/p/fBgrltIEjA2

-- 
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/4fe6a954-696c-40f1-86cf-ea9148e42ba2n%40googlegroups.com.

Reply via email to