Change suggested by iant. The compiler generates
special code for a/b when a is -0x80...0 and b = -1.
A single instruction can cover the case where b is -1,
so only one comparison is needed.
Fixes#3551.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6922049
The code inside the casee and casep labels can perfectly be merged since
they essentially do the same. The character to be stored where cp points is
just the character contained by the c variable.
R=golang-dev, dave, rsc
CC=golang-dev
https://golang.org/cl/6845112
The code that was commented out was for the old regexp package.
In the new one the errors and the space of valid regexps are different.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6873063
Implementation is mostly identical to passing a non-negative int64 to
SetInt64, and calling Int64 with a non-negative value in the *Int.
Fixes#4389.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6929048
Also, implement a global OPTIONS * handler, like Apache.
Permit sending "*" requests to handlers, but not path-based
(ServeMux) handlers. That means people can go out of their
way to support SSDP or SIP or whatever, but most users will be
unaffected.
See RFC 2616 Section 5.1.2 (Request-URI)
See RFC 2616 Section 9.2 (OPTIONS)
Fixes#3692
R=rsc
CC=golang-dev
https://golang.org/cl/6868095
This check for BADWIDTH might happen while in defercheckwidth, making it raise errors for non-erroneous situations.
Fixes#4495.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6927043
Putting it before the Index (where it is now) is wrong:
we don't even know what's in the package yet.
Fixes#4484.
R=adg, dsymonds
CC=golang-dev
https://golang.org/cl/6868071
We have been using all three terms "indices", "indexes",
and "index expressions" indiscriminatly for index values.
With this change, "index" refers to an index value,
"indices" is the plural of "index", and "index expression"
refers to an array, slice, or map indexed by an index: a[x].
R=r, rsc, iant, ken, mtj
CC=golang-dev
https://golang.org/cl/6912056
Can happen in both request and response.
Also use it in one place that wasn't.
Fixes#3997.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6903057
Fixes#4492.
% go version
go version devel +6b602ab487d6 Sat Dec 08 14:43:00 2012 +0100 linux/amd64
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6906058
New in Go 1 will be nanosecond precision in the result of time.Now on Linux.
This will break code that stores time in external formats at microsecond
precision, reads it back, and expects to get exactly the same time.
Code like that can be fixed by using time.Now().Round(time.Microsecond)
instead of time.Now() in those contexts.
R=golang-dev, bradfitz, iant, remyoudompheng
CC=golang-dev
https://golang.org/cl/6903050
This changes the output of
rand.Seed(0)
perm := rand.Perm(100)
When giving the same seeds to Go 1.0 and Go 1.1 programs
I would like them to generate the same random numbers.
««« original CL description
math/rand: remove noop iteration in Perm
The first iteration always do `m[0], m[0] = m[0], m[0]`, because
`rand.Intn(1)` is 0.
fun note: IIRC in TAOCP version of this algorithm, `i` goes
backward (n-1->1), meaning that the "already" shuffled part of the
array is never altered betweens iterations, while in the current
implementation the "not-yet" shuffled part of the array is
conserved between iterations.
R=golang-dev
CC=golang-dev
https://golang.org/cl/6845121
»»»
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6905049
gotype can now handle much of the standard library.
- marked packages which have type checker issues
- this CL depends on CL 6846131
R=rsc
CC=golang-dev
https://golang.org/cl/6850130
Also:
- better handling of type assertions
- implemented built-in error type
- first cut at handling variadic function signatures
- several bug fixes
R=rsc, rogpeppe
CC=golang-dev
https://golang.org/cl/6846131
The spec didn't preclude invalid type assertions and
type switches, i.e., cases where a concrete type doesn't
implement the interface type in the assertion in the first
place. Both, the gc and gccgo compiler exclude these cases.
This is documenting the status quo.
Also:
- minor clean up of respective examples
- added sentence about default case in select statements
Fixes#4472.
R=rsc, iant, r, ken
CC=golang-dev
https://golang.org/cl/6869050