Descriptionallow copy of struct containing unexported fields
An experiment: allow structs to be copied even if they
contain unexported fields. This gives packages the
ability to return opaque values in their APIs, like reflect
does for reflect.Value but without the kludgy hacks reflect
resorts to.
In general, we trust programmers not to do silly things
like *x = *y on a package's struct pointers, just as we trust
programmers not to do unicode.Letter = unicode.Digit,
but packages that want a harder guarantee can introduce
an extra level of indirection, like in the changes to os.File
in this CL or by using an interface type.
All in one CL so that it can be rolled back more easily if
we decide this is a bad idea.
Originally discussed in March 2011.
https://groups.google.com/group/golang-dev/t/3f5d30938c7c45ef
Patch Set 1 #Patch Set 2 : diff -r c987cc71cf15 https://go.googlecode.com/hg #Patch Set 3 : diff -r 507c01c355a1 https://go.googlecode.com/hg #Patch Set 4 : diff -r 507c01c355a1 https://go.googlecode.com/hg #
Total comments: 1
Patch Set 5 : diff -r 507c01c355a1 https://go.googlecode.com/hg #Patch Set 6 : diff -r 4b5c859153bb https://go.googlecode.com/hg #
Total comments: 1
Patch Set 7 : diff -r d29fa3306eaf https://go.googlecode.com/hg #
MessagesTotal messages: 12
|