1
0
mirror of https://github.com/golang/go synced 2024-11-20 02:24:43 -07:00
go/doc
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
..
codelab/wiki renaming_4: gofix -r everything/but/src/pkg 2011-11-08 15:43:02 -08:00
codewalk renaming_4: gofix -r everything/but/src/pkg 2011-11-08 15:43:02 -08:00
devel doc: htmlescape weekly notes 2011-11-09 13:52:02 -05:00
gopher doc/gopher: add a small gif to use as an app engine logo on GAE pages. 2011-06-14 17:25:57 +10:00
play godoc: add dummy playground.js to silence godoc warning at start-up 2011-08-22 14:06:07 -07:00
progs doc/progs: fix windows version to satisfy new error 2011-11-14 20:53:03 +11:00
talks renaming_4: gofix -r everything/but/src/pkg 2011-11-08 15:43:02 -08:00
all.css go/doc, godoc, gotest: support for reading example documentation 2011-10-06 11:56:17 -07:00
button_background.png golang.org redesign 2010-09-16 14:01:02 +10:00
code.html doc: there's no such thing as a .cgo file 2011-03-04 16:28:27 +11:00
codereview_with_mq.html doc: various changes for validating HTML 2010-08-30 09:58:27 +10:00
community.html golang.org redesign 2010-09-16 14:01:02 +10:00
contrib.html doc: put Release History link on 'Documentation' page 2011-05-27 16:07:30 +10:00
contribute.html contrib*.html: make "golang-dev" the default reviewer. 2011-05-13 16:25:31 -07:00
debugging_with_gdb.html all: rename os.Error to error in various non-code contexts 2011-11-01 22:58:09 -04:00
docs.html doc: refer to tour.golang.org instead of go-tour.appspot.com 2011-11-01 16:09:29 +09:00
effective_go.html effective_go: a little more about comma ok and type assertion 2011-11-09 16:14:18 -08:00
effective_go.tmpl effective_go: a little more about comma ok and type assertion 2011-11-09 16:14:18 -08:00
ExpressivenessOfGo.pdf fix bug in example. need to convert Value to float in Abs example 2010-10-18 16:05:50 -07:00
frontpage.css doc: add I/O 2011 talks to talks/, docs.html, and front page. 2011-05-17 13:46:54 +10:00
gccgo_contribute.html docs: make "runtime" a word only as a name for the package. 2011-03-01 13:54:22 -08:00
gccgo_install.html doc: when configuring gold for gccgo, use --enable-gold=default 2011-09-19 11:54:07 -07:00
go_faq.html FAQ: rearrange and expand the discussion of testing 2011-11-09 13:19:23 -08:00
go_for_cpp_programmers.html docs: make "runtime" a word only as a name for the package. 2011-03-01 13:54:22 -08:00
go_mem.html doc: fix memory model read visibility bug 2011-09-26 12:54:30 -04:00
go_spec.html allow copy of struct containing unexported fields 2011-11-15 12:20:59 -05:00
go_tutorial.html tutorial: describe unidirectional channels 2011-11-10 14:02:14 -08:00
go_tutorial.tmpl tutorial: describe unidirectional channels 2011-11-10 14:02:14 -08:00
go-logo-black.png
go-logo-blue.png
go-logo-white.png
GoCourseDay1.pdf doc/GoCourseDay1: shrink the PDF by rewriting it using ps2pdf. 2011-06-20 12:36:14 +10:00
GoCourseDay2.pdf docs: Update notes for 3-day Go course. 2011-06-10 15:05:51 +10:00
GoCourseDay3.pdf docs: Update notes for 3-day Go course. 2011-06-10 15:05:51 +10:00
godocs.js godoc: generate package toc in template, not in JavaScript 2011-10-18 16:23:35 -04:00
ie.css golang.org redesign 2010-09-16 14:01:02 +10:00
install.html doc/install: add openbsd 2011-11-14 07:52:36 -08:00
logo-153x55.png
logo.png golang.org redesign 2010-09-16 14:01:02 +10:00
Makefile doc/Makefile: add 'all' rule to build all docs 2011-11-01 09:45:04 -07:00
makehtml effective_go: convert to use tmpltohtml. 2011-08-21 09:46:19 +10:00
play_overlay.png golang.org redesign 2010-09-16 14:01:02 +10:00
playground.html playground.html: filesystem is not a word. 2010-10-06 23:56:13 +02:00
popups.js
root.html doc: refer to tour.golang.org instead of go-tour.appspot.com 2011-11-01 16:09:29 +09:00
sieve.gif
tmpltohtml.go renaming_4: gofix -r everything/but/src/pkg 2011-11-08 15:43:02 -08:00
video-001.png golang.org redesign 2010-09-16 14:01:02 +10:00
video-002.png golang.org redesign 2010-09-16 14:01:02 +10:00
video-003.png golang.org redesign 2010-09-16 14:01:02 +10:00
video-004.png doc: add Practical Go Programming to front page and docs.html 2010-12-03 06:57:30 +09:00
video-005.jpg doc: add I/O 2011 talks to talks/, docs.html, and front page. 2011-05-17 13:46:54 +10:00