-
Notifications
You must be signed in to change notification settings - Fork 18k
interface and func as parameters #52146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In a function call like t1 := a
t2 := SetAI(&a)
m("A", t1, t2) or it could be equivalent to t2 := SetAI(&s)
t1 := a
m("A", t1, t2) Different compilers can produce different results. Even different versions of the same compiler can produce different results. In general we do not use the issue tracker for questions. If you have further questions about Go please use a forum. See https://go.dev/wiki/Questions. Thanks. |
related issues:
The current issue is for function argument passing. In fact, result returning and argument passing are also value assignments. |
I got it, thanks everyone! |
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?
The results are different when struct A has only one field and B has two or above fields, and it just happens when parameter type is interface.
I'm not sure if that's a bug.
Please clear my doubts, tx!
The text was updated successfully, but these errors were encountered: