• Russ Cox's avatar
    allow copy of struct containing unexported fields · d03611f6
    Russ Cox authored
    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
    
    R=golang-dev, adg, dvyukov, r, bradfitz, jan.mercl, gri
    CC=golang-dev
    https://golang.org/cl/5372095
    d03611f6
Name
Last commit
Last update
..
archive Loading commit data...
bufio Loading commit data...
builtin Loading commit data...
bytes Loading commit data...
compress Loading commit data...
container Loading commit data...
crypto Loading commit data...
debug Loading commit data...
encoding Loading commit data...
errors Loading commit data...
exp Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
hash Loading commit data...
html Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
io Loading commit data...
log Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
old Loading commit data...
os Loading commit data...
patch Loading commit data...
path Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
testing Loading commit data...
text Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
websocket Loading commit data...
Makefile Loading commit data...
deps.bash Loading commit data...