mirror of
https://github.com/golang/go
synced 2024-11-23 19:20:03 -07:00
spec: struct tags must be identical for types to be identical
We didn't mention this explicitly during our discussions, but I think it fits the "identical types are spelled identically" rule that we used. R=gri, iant, ken2, r, rsc1 CC=golang-dev https://golang.org/cl/1698043
This commit is contained in:
parent
3ce29380d5
commit
e495351ff7
@ -1263,7 +1263,8 @@ literal structure and corresponding components have identical types. In detail:
|
||||
<li>Two slice types are identical if they have identical element types.</li>
|
||||
|
||||
<li>Two struct types are identical if they have the same sequence of fields,
|
||||
and if corresponding fields have the same names and identical types.
|
||||
and if corresponding fields have the same names, and identical types,
|
||||
and identical tags.
|
||||
Two anonymous fields are considered to have the same name. Lower-case field
|
||||
names from different packages are always different.</li>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user