• 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
..
exec Loading commit data...
signal Loading commit data...
user Loading commit data...
Makefile Loading commit data...
dir_plan9.go Loading commit data...
dir_unix.go Loading commit data...
dir_windows.go Loading commit data...
env.go Loading commit data...
env_test.go Loading commit data...
error.go Loading commit data...
error_plan9.go Loading commit data...
error_posix.go Loading commit data...
exec.go Loading commit data...
exec_plan9.go Loading commit data...
exec_posix.go Loading commit data...
exec_unix.go Loading commit data...
exec_windows.go Loading commit data...
file.go Loading commit data...
file_plan9.go Loading commit data...
file_posix.go Loading commit data...
file_unix.go Loading commit data...
file_windows.go Loading commit data...
getwd.go Loading commit data...
mkunixsignals.sh Loading commit data...
os_test.go Loading commit data...
path.go Loading commit data...
path_plan9.go Loading commit data...
path_test.go Loading commit data...
path_unix.go Loading commit data...
path_windows.go Loading commit data...
proc.go Loading commit data...
stat_darwin.go Loading commit data...
stat_freebsd.go Loading commit data...
stat_linux.go Loading commit data...
stat_openbsd.go Loading commit data...
stat_plan9.go Loading commit data...
stat_windows.go Loading commit data...
str.go Loading commit data...
sys_bsd.go Loading commit data...
sys_linux.go Loading commit data...
sys_plan9.go Loading commit data...
sys_windows.go Loading commit data...
time.go Loading commit data...
types.go Loading commit data...