I don't understand the question. This has always been how the language
worked, all the way back to Go 1.0 at least. As far as I'm aware.

Embedding only effects selector expressions and methods sets - i.e. it
allows you to write `v.Name` instead of writing `v.Base.Name`. It doesn't
affect composite literals.

On Mon, Jun 7, 2021 at 11:20 AM Ally Dale <vipa...@gmail.com> wrote:

> Does anyone konw which proposal changes the access for embeded field name
> of struct?
> Eg:
> ```
> type Base struct{
>     Name string
> }
> type Value struct{
>     Base
> }
> ```
>
> We initial a Value as:
> var v = Value{
>     Base: Base{
>         Name:"xxx",
>     }
> }
> instead of
> var v = Value{
>         Name:"xxx",
> }
>
> I want to know why golang change the access method.
> Anyone who knows the isssue link, please reply me. Thanks a lot.
>
> --
> 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/ff4f3443-c863-4d96-958c-76023979b0ben%40googlegroups.com
> <https://groups.google.com/d/msgid/golang-nuts/ff4f3443-c863-4d96-958c-76023979b0ben%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAEkBMfG%2B18zTbSsNq--hx%2Bqa90%3D3TLHtiviKwCd6o7fNPsDmkA%40mail.gmail.com.

Reply via email to