1
0
mirror of https://github.com/golang/go synced 2024-10-04 14:31:21 -06:00
go/src/pkg
Russ Cox d03611f628 allow 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

R=golang-dev, adg, dvyukov, r, bradfitz, jan.mercl, gri
CC=golang-dev
https://golang.org/cl/5372095
2011-11-15 12:20:59 -05:00
..
archive renaming_2: gofix -r go1pkgrename src/pkg/[a-l]* 2011-11-08 15:40:58 -08:00
bufio various: reduce overuse of os.EINVAL + others 2011-11-13 22:42:42 -05:00
builtin builtin: document delete 2011-11-09 10:49:41 -08:00
bytes various: avoid func compare 2011-11-13 22:57:19 -05:00
compress various: avoid func compare 2011-11-13 22:57:19 -05:00
container container/heap: document what Push and Pop do 2011-11-03 15:30:57 -04:00
crypto crypto/tls: fix handshake message test 2011-11-14 15:21:08 -05:00
debug all: sort imports 2011-11-02 15:54:16 -04:00
encoding encoding/json: add marshal/unmarshal benchmark 2011-11-15 10:58:19 -05:00
errors errors: new package 2011-11-01 21:46:59 -04:00
exp sql: add DB.Close, fix bugs, remove Execer on Driver (only Conn) 2011-11-14 10:48:26 -08:00
expvar renaming_2: gofix -r go1pkgrename src/pkg/[a-l]* 2011-11-08 15:40:58 -08:00
flag src/pkg/[a-m]*: gofix -r error -force=error 2011-11-01 22:04:37 -04:00
fmt fmt: distinguish empty vs nil slice/map in %#v 2011-11-14 16:10:58 -05:00
go go/build: fix build 2011-11-15 10:27:43 +09:00
hash src/pkg/[a-m]*: gofix -r error -force=error 2011-11-01 22:04:37 -04:00
html html: auto-close <p> elements when starting <form> element. 2011-11-15 15:31:22 +11:00
image various: reduce overuse of os.EINVAL + others 2011-11-13 22:42:42 -05:00
index/suffixarray renaming_2: gofix -r go1pkgrename src/pkg/[a-l]* 2011-11-08 15:40:58 -08:00
io net, io/ioutil: remove use of os.Time 2011-11-11 14:40:41 -05:00
log various: reduce overuse of os.EINVAL + others 2011-11-13 22:42:42 -05:00
math math/big: replace nat{} -> nat(nil) 2011-11-14 13:35:22 -08:00
mime various: reduce overuse of os.EINVAL + others 2011-11-13 22:42:42 -05:00
net net/http: fix build 2011-11-15 14:04:58 +09:00
old renaming_3: gofix -r go1pkgrename src/pkg/[m-z]* 2011-11-08 15:41:54 -08:00
os allow copy of struct containing unexported fields 2011-11-15 12:20:59 -05:00
patch src/pkg/[n-z]*: gofix -r error -force=error 2011-11-01 22:05:34 -04:00
path renaming_3: gofix -r go1pkgrename src/pkg/[m-z]* 2011-11-08 15:41:54 -08:00
reflect reflect: empty slice/map is not DeepEqual to nil 2011-11-14 16:11:15 -05:00
regexp regexp: fix doc comment 2011-11-09 13:46:54 -05:00
runtime runtime: avoid allocation for make([]T, 0) 2011-11-15 12:05:25 -05:00
sort renaming_3: gofix -r go1pkgrename src/pkg/[m-z]* 2011-11-08 15:41:54 -08:00
strconv strconv: make Ftoa faster 2011-11-15 12:17:25 -05:00
strings various: avoid func compare 2011-11-13 22:57:19 -05:00
sync allow copy of struct containing unexported fields 2011-11-15 12:20:59 -05:00
syscall syscall: take over env implementation 2011-11-14 14:06:50 -05:00
testing testing: add file:line stamps to messages. 2011-11-10 11:59:50 -08:00
text various: reduce overuse of os.EINVAL + others 2011-11-13 22:42:42 -05:00
time time: fix test hang 2011-11-14 22:31:39 +03:00
unicode renaming_3: gofix -r go1pkgrename src/pkg/[m-z]* 2011-11-08 15:41:54 -08:00
unsafe unsafe: update doc 2011-08-31 17:59:35 -04:00
websocket various: reduce overuse of os.EINVAL + others 2011-11-13 22:42:42 -05:00
deps.bash renaming_1: hand-edited files for go 1 renaming 2011-11-08 15:38:47 -08:00
Makefile httputil: move ReverseProxy out of http 2011-11-03 15:54:08 -07:00