You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text was updated successfully, but these errors were encountered:
wendellrios
changed the title
Unexpected behavior or error.As if the struct has the same name as one of its methods
errors: Unexpected behavior of errors.As if the struct has the same name as one of its methods
Jun 18, 2021
This is how the language works. In your second test the embedded field and method conflict so the method isn’t promoted. B really doesn’t have a UserError method.
If you try and call it manually you’ll see something like:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/gWmNCTUMtau
What did you expect to see?
PASS: TestCanEmbedPointerIfTypeNameIsEqualMethodName
What did you see instead?
--- FAIL: TestCanEmbedPointerIfTypeNameIsEqualMethodName (0.00s)
The text was updated successfully, but these errors were encountered: