I think the real issue is that the error message doesn't make it clear that it's the embedded interface that is nil. I looked for a nil member, or the instance being nil itself, but I didn't think of checking the embedded interfaces.
I guess it's also part of being used to inheritance from C++ and Java (and generally learning to code in the 90s-00s), and I'll get used to double-checking embedded types. But it wouldn't hurt to have a more explicit error message, that would shave a few minutes off debugging the panic, even for experienced Go practitioners. And it would also ease the path for newcomers.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I think the real issue is that the error message doesn't make it clear that it's the embedded interface that is
nil
. I looked for anil
member, or the instance beingnil
itself, but I didn't think of checking the embedded interfaces.I guess it's also part of being used to inheritance from C++ and Java (and generally learning to code in the 90s-00s), and I'll get used to double-checking embedded types. But it wouldn't hurt to have a more explicit error message, that would shave a few minutes off debugging the panic, even for experienced Go practitioners. And it would also ease the path for newcomers.