This CL replaces my earlier https://golang.org/cl/1640044/show
in which Continue handling was explicit. Instead, this CL makes
it automatic. Reading from Body() is an implicit acknowledgement
that the request headers were fine and the body is wanted. In that
case, the 100 Continue response is written automatically when the
request continues the "Expect: 100-continue" header.
R=rsc, adg
CC=golang-dev
https://golang.org/cl/1610042
While we're at it, clean up and test the code to guarantee we see every byte when
the text is erroneous UTF-8.
Fixes#866.
R=rsc
CC=golang-dev
https://golang.org/cl/1712042
This shortens, simplifies and regularizes the code significantly.
(Improvements to reflect could make another step.)
Passes all.bash.
One semantic change occurs: The String() method changes
behavior. It used to run only for string formats such as %s and %q.
Instead, it now runs whenever the item has the method and the
result is then processed by the format as a string. Besides the
regularization, this has three effects:
1) width is honored for String() items
2) %x works for String() items
3) implementations of String that merely recur will recur forever
Regarding point 3, example from the updated documentation:
type X int
func (x X) String() string { return Sprintf("%d", x) }
should cast the value before recurring:
func (x X) String() string { return Sprintf("%d", int(x)) }
R=rsc
CC=golang-dev
https://golang.org/cl/1613045
Change TrimRight and TrimLeft to use these functions.
Incidentally fix minor bug in TrimRight.
Add some test cases for this.
YMMV whether it's worth saving the closure allocation.
R=r, r2
CC=golang-dev, hoisie, rsc
https://golang.org/cl/1198044
Cannot assume that g == m->curg at time of signal.
Must save actual g and restore.
Fixes flaky crashes with messages like
throw: malloc mlookup
throw: malloc/free - deadlock
throw: unwindstack on self
throw: free mlookup
(and probably others) when running cgo.
R=iant
CC=golang-dev
https://golang.org/cl/1648043
There's only one Go object file per package now,
so there's no need to parse the metadata and merge
metadata from multiple files. Just save the original
and use it as __.PKGDEF verbatim.
R=r
CC=golang-dev
https://golang.org/cl/1647042
This avoids a crash when using cgo where glibc's malloc thinks
that it can use some of the memory following the symbol table.
This fails because the symbol table is mapped read-only, which
affects the whole page.
R=rsc
CC=golang-dev
https://golang.org/cl/1616042
Although technically incorrect, we want this in order to parse X.509
certificates where a wildcard hostname ("*.example.com") has been put
into a PrintableString.
Fixes#850.
R=rsc
CC=golang-dev
https://golang.org/cl/1615043
* Code for assignment, conversions now mirrors spec.
* Changed some snprint -> smprint.
* Renamed runtime functions to separate
interface conversions from type assertions:
convT2I, assertI2T, etc.
* Correct checking of \U sequences.
Fixes#840.
Fixes#830.
Fixes#778.
R=ken2
CC=golang-dev
https://golang.org/cl/1303042
(caused certain files to not be idempotent under gofmt)
- corrected golden files for go/printer
- slightly simplified some code in nodes.go (no impact on formatting)
- these changes have no impact on gofmt output of .go files under src, misc
fallthrough statement considered harmful!
R=rsc
CC=golang-dev
https://golang.org/cl/1593042